summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--lib/securerandom.rb1
-rw-r--r--random.c3
3 files changed, 7 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 92352d8d15..bf1a35024e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sat Feb 6 00:02:31 2010 Tanaka Akira <akr@fsij.org>
+
+ * random.c (fill_random_seed): don't use O_NOFOLLOW because
+ /dev/urandom is a symlink in OpenSolaris.
+
+ * lib/securerandom.rb (SecureRandom.random_bytes: ditto.
+
Fri Feb 5 23:09:01 2010 Akinori MUSHA <knu@iDaemons.org>
* ext/rational/rational.c: Added to provide a fast implementation
diff --git a/lib/securerandom.rb b/lib/securerandom.rb
index ee9be9bde4..2676c3b536 100644
--- a/lib/securerandom.rb
+++ b/lib/securerandom.rb
@@ -57,7 +57,6 @@ module SecureRandom
flags = File::RDONLY
flags |= File::NONBLOCK if defined? File::NONBLOCK
flags |= File::NOCTTY if defined? File::NOCTTY
- flags |= File::NOFOLLOW if defined? File::NOFOLLOW
begin
File.open("/dev/urandom", flags) {|f|
unless f.stat.chardev?
diff --git a/random.c b/random.c
index c0e8912955..92ef3fcae5 100644
--- a/random.c
+++ b/random.c
@@ -280,9 +280,6 @@ random_seed()
#ifdef O_NOCTTY
|O_NOCTTY
#endif
-#ifdef O_NOFOLLOW
- |O_NOFOLLOW
-#endif
)) >= 0) {
if (fstat(fd, &statbuf) == 0 && S_ISCHR(statbuf.st_mode)) {
read(fd, seed, seed_len);