version 1.12 | | version 1.13 |
---|
| | |
/* | | /* |
* static char *rcsid_init_c = | | * static char *rcsid_init_c = |
* "$Id: init.c,v 1.12 2001/04/06 00:40:18 michtoen Exp $"; | | * "$Id: init.c,v 1.13 2001/04/06 19:07:10 michtoen Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
void set_csport(char *val) | | void set_csport(char *val) |
{ | | { |
settings.csport=atoi(val); | | settings.csport=atoi(val); |
#ifndef WIN32 // ***win32: set_csport: we remove csport error secure check here, do this later | | #ifndef WIN32 /* ***win32: set_csport: we remove csport error secure check here, do this later */ |
if (settings.csport<=0 || settings.csport>32765 || | | if (settings.csport<=0 || settings.csport>32765 || |
(settings.csport<1024 && getuid()!=0)) { | | (settings.csport<1024 && getuid()!=0)) { |
fprintf(stderr,"%d is an invalid csport number.\n",settings.csport); | | fprintf(stderr,"%d is an invalid csport number.\n",settings.csport); |
exit(1); | | exit(1); |
} | | } |
#endif // win32 | | #endif /* win32 */ |
} | | } |
| | |
static void stat_loss_on_death_true() {settings.stat_loss_on_death = 1; } | | static void stat_loss_on_death_true() {settings.stat_loss_on_death = 1; } |
| | |
| | |
parse_args(argc, argv, 3); | | parse_args(argc, argv, 3); |
| | |
#ifndef WIN32 // ***win32: no BecomeDaemon in windows | | #ifndef WIN32 /* ***win32: no BecomeDaemon in windows */ |
if (settings.daemonmode) | | if (settings.daemonmode) |
logfile = BecomeDaemon(settings.logfilename[0]=='\0'?"logfile":settings.logfilename); | | logfile = BecomeDaemon(settings.logfilename[0]=='\0'?"logfile":settings.logfilename); |
#endif | | #endif |
| | |
#endif | | #endif |
printf("Max_time:\t%d\n",MAX_TIME); | | printf("Max_time:\t%d\n",MAX_TIME); |
| | |
#ifdef WIN32 // ***win32 compile_info(): remove execl... | | #ifdef WIN32 /* ***win32 compile_info(): remove execl... */ |
printf("Logfilename:\t%s\n",settings.logfilename); | | printf("Logfilename:\t%s\n",settings.logfilename); |
exit(0); | | exit(0); |
#else | | #else |
| | |
* be looked at later on, and maybe fix the problem that caused it to | | * be looked at later on, and maybe fix the problem that caused it to |
* dump core. There is no reason that SIGPIPES should be fatal | | * dump core. There is no reason that SIGPIPES should be fatal |
*/ | | */ |
#if 1 && !defined(WIN32) // ***win32: we don't want send SIGPIPE | | #if 1 && !defined(WIN32) /* ***win32: we don't want send SIGPIPE */ |
LOG(llevInfo,"\nReceived SIGPIPE, ignoring...\n"); | | LOG(llevInfo,"\nReceived SIGPIPE, ignoring...\n"); |
signal(SIGPIPE,rec_sigpipe);/* hocky-pux clears signal handlers */ | | signal(SIGPIPE,rec_sigpipe);/* hocky-pux clears signal handlers */ |
#else | | #else |
| | |
} | | } |
| | |
void init_signals() { | | void init_signals() { |
#ifndef WIN32 // init_signals() remove signals | | #ifndef WIN32 /* init_signals() remove signals */ |
signal(SIGHUP,rec_sighup); | | signal(SIGHUP,rec_sighup); |
signal(SIGINT,rec_sigint); | | signal(SIGINT,rec_sigint); |
signal(SIGQUIT,rec_sigquit); | | signal(SIGQUIT,rec_sigquit); |
| | |
signal(SIGBUS,rec_sigbus); | | signal(SIGBUS,rec_sigbus); |
#endif | | #endif |
signal(SIGTERM,rec_sigterm); | | signal(SIGTERM,rec_sigterm); |
#endif // win32 | | #endif /* win32 */ |
} | | } |
| | |
/* | | /* |