1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-10 08:43:12 +02:00

Misc. fixes

This commit is contained in:
codemastr
2003-01-11 19:33:42 +00:00
parent fe9dc6d3c4
commit fed61efcdb
6 changed files with 27 additions and 22 deletions
+2 -11
View File
@@ -135,20 +135,11 @@ struct _timeb nowt;
/* Grab OS specific "random" data */
#ifndef _WIN32
gettimeofday(&nowt, NULL);
fd = open("/dev/random", O_RDONLY);
fd = open("/dev/urandom", O_RDONLY);
if (fd) {
(void)read(fd, &xrnd, sizeof(int));
Debug((DEBUG_INFO, "init_random: read from /dev/random: 0x%.8x", xrnd));
Debug((DEBUG_INFO, "init_random: read from /dev/urandom: 0x%.8x", xrnd));
close(fd);
} else {
fd = open("/dev/urandom", O_RDONLY);
if (fd) {
(void)read(fd, &xrnd, sizeof(int));
Debug((DEBUG_INFO, "init_random: read from /dev/urandom: 0x%.8x", xrnd));
close(fd);
} else {
Debug((DEBUG_INFO, "init_random: [BAD] nothing read from random devices"));
}
}
#else
_ftime(&nowt);