summaryrefslogtreecommitdiffstats
path: root/libc/stdlib/arc4random.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2011-03-18 10:57:31 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2011-12-23 15:49:01 +0100
commit8f71a37896be4ce64c009b369117b252eb4de366 (patch)
treed1732f240df4555e6a87285972b118b4ebba07ac /libc/stdlib/arc4random.c
parentb1aea0b3872b246cf17f04d5442a94e39e45203e (diff)
downloaduClibc-alpine-8f71a37896be4ce64c009b369117b252eb4de366.tar.bz2
uClibc-alpine-8f71a37896be4ce64c009b369117b252eb4de366.tar.xz
stdlib: fix arc4random return type to u_int32_t
It's documented to be u_int32_t and not uint32_t: http://www.manpagez.com/man/3/arc4random/ This also fixes a major bug that stdlib.h includes stdint.h. Things might go very wrong because stdint.h has conditional defines and if stdlib.h is included before #define's for stdint.h we end up missing things and breaking builds (e.g. openjdk). Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Diffstat (limited to 'libc/stdlib/arc4random.c')
-rw-r--r--libc/stdlib/arc4random.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libc/stdlib/arc4random.c b/libc/stdlib/arc4random.c
index c7aed66b6..7b9b12d6f 100644
--- a/libc/stdlib/arc4random.c
+++ b/libc/stdlib/arc4random.c
@@ -30,6 +30,7 @@
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
+#include <stdint.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/time.h>
@@ -175,7 +176,7 @@ arc4random_addrandom(u_char *dat, int datlen)
arc4_addrandom(&rs, dat, datlen);
}
-uint32_t
+u_int32_t
arc4random(void)
{
if (!rs_initialized)