summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
Diffstat (limited to 'random.c')
-rw-r--r--random.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/random.c b/random.c
index e55e4e7ad4..36b45a5fe5 100644
--- a/random.c
+++ b/random.c
@@ -498,15 +498,15 @@ fill_random_seed(unsigned int seed[DEFAULT_SEED_CNT])
memset(seed, 0, DEFAULT_SEED_LEN);
#if USE_DEV_URANDOM
- if ((fd = open("/dev/urandom", O_RDONLY
+ if ((fd = rb_cloexec_open("/dev/urandom", O_RDONLY
#ifdef O_NONBLOCK
|O_NONBLOCK
#endif
#ifdef O_NOCTTY
|O_NOCTTY
#endif
- )) >= 0) {
- rb_fd_set_cloexec(fd);
+ , 0)) >= 0) {
+ rb_update_max_fd(fd);
if (fstat(fd, &statbuf) == 0 && S_ISCHR(statbuf.st_mode)) {
if (read(fd, seed, DEFAULT_SEED_LEN) < DEFAULT_SEED_LEN) {
/* abandon */;