summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
Diffstat (limited to 'random.c')
-rw-r--r--random.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/random.c b/random.c
index 82a51ccb6d..8ea3d77f22 100644
--- a/random.c
+++ b/random.c
@@ -624,7 +624,8 @@ random_raw_seed(VALUE self, VALUE size)
long n = NUM2ULONG(size);
VALUE buf = rb_str_new(0, n);
if (n == 0) return buf;
- if (fill_random_bytes(RSTRING_PTR(buf), n, FALSE)) return Qnil;
+ if (fill_random_bytes(RSTRING_PTR(buf), n, FALSE))
+ rb_raise(rb_eRuntimeError, "failed to get urandom");
return buf;
}