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

not if (fd) but if (fd >= 0)..

This commit is contained in:
Bram Matthys
2015-07-16 18:14:22 +02:00
parent 252538272e
commit f8241cede6
+3 -3
View File
@@ -192,9 +192,9 @@ MEMORYSTATUS mstat;
#ifndef _WIN32
gettimeofday(&rdat.nowt, NULL);
fd = open("/dev/urandom", O_RDONLY);
if (fd) {
int n;
n = read(fd, &rdat.rnd, sizeof(rdat.rnd));
if (fd >= 0)
{
int n = read(fd, &rdat.rnd, sizeof(rdat.rnd));
Debug((DEBUG_INFO, "init_random: read from /dev/urandom returned %d", n));
close(fd);
}