summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authorocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-01-06 08:24:04 +0000
committerocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-01-06 08:24:04 +0000
commit992cd33d1a41f4b0650d5581ce1b561a6c40d908 (patch)
treed686768bcb2d72cc8de222425e81e8b8c834a434 /random.c
parentedfdf57089386fd420f143125ea366038041c5ff (diff)
* random.c (random_seed): O_NONBLOCK isn't defined on some
platforms. [ruby-dev:25417] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r--random.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/random.c b/random.c
index b069c1dc89..6a4ed2d286 100644
--- a/random.c
+++ b/random.c
@@ -275,7 +275,10 @@ random_seed()
memset(digits, 0, big->len * SIZEOF_BDIGITS);
#ifdef S_ISCHR
- if ((fd = open("/dev/urandom", O_RDONLY|O_NONBLOCK
+ if ((fd = open("/dev/urandom", O_RDONLY
+#ifdef O_NONBLOCK
+ |O_NONBLOCK
+#endif
#ifdef O_NOCTTY
|O_NOCTTY
#endif