summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rand.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rand.c b/src/rand.c
index 1742ef13..be63c922 100644
--- a/src/rand.c
+++ b/src/rand.c
@@ -113,7 +113,8 @@ static int li_rand_device_bytes (unsigned char *buf, int num)
ssize_t rd = 0;
#ifdef RNDGETENTCNT
int entropy;
- if (0 == ioctl(fd, RNDGETENTCNT, &entropy) && entropy >= num*8)
+ if (0 == ioctl(fd, (unsigned long)(RNDGETENTCNT), &entropy)
+ && entropy >= num*8)
#endif
rd = read(fd, buf, (size_t)num);
close(fd);