From d68b152c3e2feb6ee18bdf2c992098376dbb528c Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 16 Jul 2015 11:59:53 -0700 Subject: std: Be resilient to failure in pthread_getattr_np This can fail on linux for various reasons, such as the /proc filesystem not being mounted. There are already many cases where we can't set up stack guards, so just don't worry about this case and communicate that no guard was enabled. I've confirmed that this allows the compiler to run in a chroot without /proc mounted. Closes #22642 --- src/libstd/sys/windows/thread.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/libstd/sys/windows') diff --git a/src/libstd/sys/windows/thread.rs b/src/libstd/sys/windows/thread.rs index 50dfee4ab10..42805c2ac52 100644 --- a/src/libstd/sys/windows/thread.rs +++ b/src/libstd/sys/windows/thread.rs @@ -86,7 +86,8 @@ impl Thread { } pub mod guard { - pub unsafe fn main() -> usize { 0 } - pub unsafe fn current() -> usize { 0 } - pub unsafe fn init() {} + use prelude::v1::*; + + pub unsafe fn current() -> Option { None } + pub unsafe fn init() -> Option { None } } -- cgit 1.4.1-3-g733a5