about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-04-21 20:01:34 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-04-27 10:11:15 -0700
commit7dd62155d85e9556c2b2b70c03acce9910896696 (patch)
tree47d532e4f1277c8a670d2207755fb6190701e7d6 /src/libstd/sys
parent5f518ad658fe3914f3817285c484409a582cba96 (diff)
downloadrust-7dd62155d85e9556c2b2b70c03acce9910896696.tar.gz
rust-7dd62155d85e9556c2b2b70c03acce9910896696.zip
std: Don't assume dlopen() works on yourself
Statically linked executables do not succeed (aka MUSL-based executables).
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/unix/thread.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstd/sys/unix/thread.rs b/src/libstd/sys/unix/thread.rs
index 281ac37e671..cfab9d1c51a 100644
--- a/src/libstd/sys/unix/thread.rs
+++ b/src/libstd/sys/unix/thread.rs
@@ -342,7 +342,10 @@ fn min_stack_size(attr: *const libc::pthread_attr_t) -> usize {
     static mut __pthread_get_minstack: Option<F> = None;
 
     INIT.call_once(|| {
-        let lib = DynamicLibrary::open(None).unwrap();
+        let lib = match DynamicLibrary::open(None) {
+            Ok(l) => l,
+            Err(..) => return,
+        };
         unsafe {
             if let Ok(f) = lib.symbol("__pthread_get_minstack") {
                 __pthread_get_minstack = Some(mem::transmute::<*const (), F>(f));