version 1.11 | | version 1.12 |
---|
| | |
/* | | /* |
* static char *rcsid_init_c = | | * static char *rcsid_init_c = |
* "$Id: init.c,v 1.11 2001/03/07 07:24:30 mwedel Exp $"; | | * "$Id: init.c,v 1.12 2001/04/06 00:40:18 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 |
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 |
} | | } |
| | |
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 |
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 |
| | |
init_beforeplay(); | | init_beforeplay(); |
init_ericserver(); | | init_ericserver(); |
| | |
printf("Random encounter:\t<false>\n"); | | printf("Random encounter:\t<false>\n"); |
#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... |
| | printf("Logfilename:\t%s\n",settings.logfilename); |
| | exit(0); |
| | #else |
execl("/bin/uname", "uname", "-a", NULL); | | execl("/bin/uname", "uname", "-a", NULL); |
LOG(llevError, "Opps, should't have gotten here."); | | LOG(llevError, "Opps, should't have gotten here."); |
perror("execl"); | | perror("execl"); |
exit(-1); | | exit(-1); |
| | #endif |
} | | } |
| | |
/* Signal handlers: */ | | /* Signal handlers: */ |
| | |
* 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 | | #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 |
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 |
} | | } |
| | |
/* | | /* |