123 |
int rehashed_klines = 0; |
int rehashed_klines = 0; |
124 |
|
|
125 |
|
|
|
#ifndef _WIN32 |
|
126 |
/* |
/* |
127 |
* print_startup - print startup information |
* print_startup - print startup information |
128 |
*/ |
*/ |
153 |
|
|
154 |
setsid(); |
setsid(); |
155 |
} |
} |
|
#endif |
|
156 |
|
|
157 |
static int printVersion = 0; |
static int printVersion = 0; |
158 |
|
|
182 |
{ |
{ |
183 |
static char to_send[200]; |
static char to_send[200]; |
184 |
struct timeval newtime; |
struct timeval newtime; |
|
#ifdef _WIN32 |
|
|
FILETIME ft; |
|
|
|
|
|
GetSystemTimeAsFileTime(&ft); |
|
|
if (ft.dwLowDateTime < 0xd53e8000) |
|
|
ft.dwHighDateTime--; |
|
|
ft.dwLowDateTime -= 0xd53e8000; |
|
|
ft.dwHighDateTime -= 0x19db1de; |
|
|
|
|
|
newtime.tv_sec = (*(uint64_t *) &ft) / 10000000; |
|
|
newtime.tv_usec = (*(uint64_t *) &ft) / 10 % 1000000; |
|
|
#else |
|
185 |
newtime.tv_sec = 0; |
newtime.tv_sec = 0; |
186 |
newtime.tv_usec = 0; |
newtime.tv_usec = 0; |
187 |
|
|
194 |
strerror(errno)); |
strerror(errno)); |
195 |
restart("Clock Failure"); |
restart("Clock Failure"); |
196 |
} |
} |
|
#endif |
|
197 |
|
|
198 |
if (newtime.tv_sec < CurrentTime) |
if (newtime.tv_sec < CurrentTime) |
199 |
{ |
{ |
385 |
static void |
static void |
386 |
check_pidfile(const char *filename) |
check_pidfile(const char *filename) |
387 |
{ |
{ |
|
#ifndef _WIN32 |
|
388 |
FBFILE *fb; |
FBFILE *fb; |
389 |
char buff[32]; |
char buff[32]; |
390 |
pid_t pidfromfile; |
pid_t pidfromfile; |
416 |
{ |
{ |
417 |
/* log(L_ERROR, "Error opening pid file %s", filename); */ |
/* log(L_ERROR, "Error opening pid file %s", filename); */ |
418 |
} |
} |
|
#endif |
|
419 |
} |
} |
420 |
|
|
421 |
/* setup_corefile() |
/* setup_corefile() |
491 |
/* Check to see if the user is running |
/* Check to see if the user is running |
492 |
* us as root, which is a nono |
* us as root, which is a nono |
493 |
*/ |
*/ |
|
#ifndef _WIN32 |
|
494 |
if (geteuid() == 0) |
if (geteuid() == 0) |
495 |
{ |
{ |
496 |
fprintf(stderr, "Don't run ircd as root!!!\n"); |
fprintf(stderr, "Don't run ircd as root!!!\n"); |
499 |
|
|
500 |
/* Setup corefile size immediately after boot -kre */ |
/* Setup corefile size immediately after boot -kre */ |
501 |
setup_corefile(); |
setup_corefile(); |
|
#endif |
|
502 |
|
|
503 |
/* save server boot time right away, so getrusage works correctly */ |
/* save server boot time right away, so getrusage works correctly */ |
504 |
set_time(); |
set_time(); |
547 |
|
|
548 |
init_ssl(); |
init_ssl(); |
549 |
|
|
|
#ifndef _WIN32 |
|
550 |
if (!server_state.foreground) |
if (!server_state.foreground) |
551 |
{ |
{ |
552 |
make_daemon(); |
make_daemon(); |
556 |
print_startup(getpid()); |
print_startup(getpid()); |
557 |
|
|
558 |
setup_signals(); |
setup_signals(); |
|
#endif |
|
559 |
|
|
560 |
get_ircd_platform(ircd_platform); |
get_ircd_platform(ircd_platform); |
561 |
|
|