this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix `getentropy`'s return value

It's supposed to return 0 if it succeeds, -1 otherwise. See `man 2 getentropy`

(It's also supposed to return EIO if it reads less bytes than were requested; this also fixes that)

+5 -1
+5 -1
src/kernel/emulation/linux/misc/getentropy.c
··· 1 1 #include "getentropy.h" 2 2 #include "../base.h" 3 3 #include "../errno.h" 4 + #include "../duct_errno.h" 4 5 #include <linux-syscalls/linux.h> 5 6 6 7 #define LINUX_GRND_RANDOM 2 ··· 13 14 if (ret < 0) 14 15 ret = errno_linux_to_bsd(ret); 15 16 16 - return ret; 17 + if (ret < size) 18 + return -EIO; 19 + 20 + return 0; 17 21 } 18 22