diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-04-21 20:01:34 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-04-27 10:11:15 -0700 |
| commit | 7dd62155d85e9556c2b2b70c03acce9910896696 (patch) | |
| tree | 47d532e4f1277c8a670d2207755fb6190701e7d6 /src/libstd | |
| parent | 5f518ad658fe3914f3817285c484409a582cba96 (diff) | |
| download | rust-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')
| -rw-r--r-- | src/libstd/sys/unix/thread.rs | 5 |
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)); |
