about summary refs log tree commit diff
path: root/src/libgreen
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-04-01 11:11:51 -0700
committerbors <bors@rust-lang.org>2014-04-01 11:11:51 -0700
commitb71c02e512fcfe18ea7a5a8a99ac758b4fa564a6 (patch)
tree7842aad2f7ad07256764e22d6ab2fad0b6f624ed /src/libgreen
parentb8ef9fd9c9f642ce7b8aed82782a1ed745d08d64 (diff)
parentbc7a2d72a3fea324fa432de9b6ce6073302d3d8c (diff)
downloadrust-b71c02e512fcfe18ea7a5a8a99ac758b4fa564a6.tar.gz
rust-b71c02e512fcfe18ea7a5a8a99ac758b4fa564a6.zip
auto merge of #13115 : huonw/rust/rand-errors, r=alexcrichton
move errno -> IoError converter into std, bubble up OSRng errors

Also adds a general errno -> `~str` converter to `std::os`, and makes the failure messages for the things using `OSRng` (e.g. (transitively) the task-local RNG, meaning hashmap initialisation failures aren't such a black box).
Diffstat (limited to 'src/libgreen')
-rw-r--r--src/libgreen/sched.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libgreen/sched.rs b/src/libgreen/sched.rs
index adfd5908de2..683df846d62 100644
--- a/src/libgreen/sched.rs
+++ b/src/libgreen/sched.rs
@@ -967,7 +967,12 @@ impl ClosureConverter for UnsafeTaskReceiver {
 // worry there.
 #[cfg(windows)]
 fn new_sched_rng() -> XorShiftRng {
-    XorShiftRng::new()
+    match XorShiftRng::new() {
+        Ok(r) => r,
+        Err(e) => {
+            rtabort!("sched: failed to create seeded RNG: {}", e)
+        }
+    }
 }
 #[cfg(unix)]
 fn new_sched_rng() -> XorShiftRng {