Mercurial > noffle
view online.c @ 38:8e972daaeab9 noffle
[svn] Applied patch from Jim Hague:
- Forget cached group info when group database closed.
- Added list of 'forbidden' newsgroup specs.
- Fixed problem with article numbering if the overview file empties.
- Changed %i to %d in sscanfs (%i interprets leading zeros as octal numbers)
- New groups now always start numbering at article 1.
- Record newsgroup posting status. Enforce it at posting time.
Added --modify
- Added group deletion.
- Added wildmat code taken from INN
author | enz |
---|---|
date | Fri, 05 May 2000 08:23:15 +0100 |
parents | 04124a4423d4 |
children |
line wrap: on
line source
/* online.c $Id: online.c 3 2000-01-04 11:35:42Z enz $ */ #include <unistd.h> #include "common.h" #include "config.h" #include "log.h" static void fileOnline( Str s ) { snprintf( s, MAXCHAR, "%s/lock/online", Cfg_spoolDir() ); } Bool Online_true( void ) { FILE *f; Str file; fileOnline( file ); if ( ! ( f = fopen( file, "r" ) ) ) return FALSE; fclose( f ); return TRUE; } void Online_set( Bool value ) { FILE *f; Str file; fileOnline( file ); if ( value ) { if ( ! ( f = fopen( file, "a" ) ) ) { Log_err( "Could not create %s", file ); return; } fclose( f ); Log_inf( "NOFFLE is now online" ); } else { if ( unlink( file ) != 0 ) { Log_err( "Cannot remove %s", file ); return; } Log_inf( "NOFFLE is now offline" ); } }