From 8531657741a5d8fb3443ccfe54f62d551dfa0aca Mon Sep 17 00:00:00 2001 From: ocean Date: Thu, 6 Jan 2005 08:24:04 +0000 Subject: [PATCH] * 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/trunk@7736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ random.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 669738deb9..ed8ce494fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Jan 6 17:22:41 2005 Hirokazu Yamamoto + + * random.c (random_seed): O_NONBLOCK isn't defined on some + platforms. [ruby-dev:25417] + Thu Jan 6 13:45:35 2005 Tanaka Akira * lib/time.rb: recognize +00:00 and GMT as a localtime. 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