/**************************************************************************** **
catch a sigterm
**************************************************************************** */
-static int sig_term(void)
+static void sig_term(int sig)
{
BlockSignals(True,SIGTERM);
exit(0);
- /* Keep compiler happy.. */
- return 0;
} /* sig_term */
/**************************************************************************** **
catch a sighup
**************************************************************************** */
-static int sig_hup(void)
+static void sig_hup(int sig)
{
BlockSignals( True, SIGHUP );
BlockSignals(False,SIGHUP);
- return(0);
} /* sig_hup */
/**************************************************************************** **
catch a sigpipe
**************************************************************************** */
-static int sig_pipe(void)
+static void sig_pipe(int sig)
{
BlockSignals( True, SIGPIPE );
if ( !is_daemon )
exit(1);
BlockSignals( False, SIGPIPE );
- return(0);
} /* sig_pipe */
#if DUMP_CORE
rlp.rlim_cur = MAX( 4*1024*1024, rlp.rlim_cur );
setrlimit( RLIMIT_CORE, &rlp );
getrlimit( RLIMIT_CORE, &rlp );
- DEBUG( 3, ( "Core limits now %d %d\n", rlp.rlim_cur, rlp.rlim_max ) );
+ DEBUG( 3, ( "Core limits now %d %d\n", (int)rlp.rlim_cur, (int)rlp.rlim_max ) );
}
#endif
#endif
printf( "\t-n netbiosname. " );
printf( "the netbios name to advertise for this host\n");
printf( "\t-H hosts file load a netbios hosts file\n" );
+ printf( "\t-a append to log file (default)\n" );
+ printf( "\t-o overwrite log file, don't append\n" );
printf( "\n");
} /* usage */
int opt;
extern FILE *dbf;
extern char *optarg;
+ extern BOOL append_log;
+
+ append_log = True; /* Default, override with '-o' option. */
global_nmb_port = NMB_PORT;
*host_file = 0;
#endif /* SIGUSR2 */
#endif /* MEM_MAN */
- while((opt = getopt(argc, argv, "as:T:I:C:bAi:B:N:Rn:l:d:Dp:hSH:G:f:")) != EOF)
+ while( EOF !=
+ (opt = getopt( argc, argv, "aos:T:I:C:bAi:B:N:Rn:l:d:Dp:hSH:G:f:" )) )
{
switch (opt)
{
strupper(scope);
break;
case 'a':
- {
- extern BOOL append_log;
- append_log = !append_log;
- }
+ append_log = True;
+ break;
+ case 'o':
+ append_log = False;
break;
case 'D':
is_daemon = True;