summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/rand.c
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@FreeBSD.org>2012-09-29 11:54:34 +0000
committerJilles Tjoelker <jilles@FreeBSD.org>2012-09-29 11:54:34 +0000
commit05eb11cbc40a190f73ed1471d97062cabfc37d54 (patch)
tree89610d7c33533a1abd5218d8db331931ee9e6327 /lib/libc/stdlib/rand.c
parent9c883c6cf029da76c3c385d1ff234c940d9ed0ef (diff)
Notes
Diffstat (limited to 'lib/libc/stdlib/rand.c')
-rw-r--r--lib/libc/stdlib/rand.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/stdlib/rand.c b/lib/libc/stdlib/rand.c
index 077c1ba4ad19..3835976e4200 100644
--- a/lib/libc/stdlib/rand.c
+++ b/lib/libc/stdlib/rand.c
@@ -121,7 +121,7 @@ sranddev()
int fd, done;
done = 0;
- fd = _open("/dev/random", O_RDONLY, 0);
+ fd = _open("/dev/random", O_RDONLY | O_CLOEXEC, 0);
if (fd >= 0) {
if (_read(fd, (void *) &next, sizeof(next)) == sizeof(next))
done = 1;