summaryrefslogtreecommitdiff
path: root/src/gant/gant.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gant/gant.c')
-rw-r--r--src/gant/gant.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gant/gant.c b/src/gant/gant.c
index 5586f99..c4e1b7c 100644
--- a/src/gant/gant.c
+++ b/src/gant/gant.c
@@ -196,11 +196,17 @@ uint randno(void)
if (fd >= 0)
{
- read(fd, &r, sizeof r);
+ ssize_t rr = read(fd, &r, sizeof r);
close(fd);
+ if(rr != sizeof r)
+ {
+ r = rand();
+ }
}
else
+ {
r = rand();
+ }
return r;
}