139 |
void |
void |
140 |
set_time(void) |
set_time(void) |
141 |
{ |
{ |
142 |
struct timeval newtime = { .tv_sec = 0, .tv_usec = 0 }; |
struct timespec newtime = { .tv_sec = 0, .tv_nsec = 0 }; |
143 |
|
|
144 |
if (gettimeofday(&newtime, NULL) == -1) |
if (clock_gettime(CLOCK_REALTIME, &newtime) == -1) |
145 |
{ |
{ |
146 |
char buf[IRCD_BUFSIZE]; |
char buf[IRCD_BUFSIZE]; |
147 |
|
|
161 |
} |
} |
162 |
|
|
163 |
SystemTime.tv_sec = newtime.tv_sec; |
SystemTime.tv_sec = newtime.tv_sec; |
164 |
SystemTime.tv_usec = newtime.tv_usec; |
SystemTime.tv_nsec = newtime.tv_nsec; |
165 |
} |
} |
166 |
|
|
167 |
static void |
static void |
382 |
set_time(); |
set_time(); |
383 |
|
|
384 |
/* It's not random, but it ought to be a little harder to guess */ |
/* It's not random, but it ought to be a little harder to guess */ |
385 |
init_genrand(SystemTime.tv_sec ^ (SystemTime.tv_usec | (getpid() << 20))); |
init_genrand(SystemTime.tv_sec ^ (SystemTime.tv_nsec / 1000 | (getpid() << 20))); |
386 |
|
|
387 |
ConfigGeneral.dpath = DPATH; |
ConfigGeneral.dpath = DPATH; |
388 |
ConfigGeneral.spath = SPATH; |
ConfigGeneral.spath = SPATH; |