about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorVadim Chugunov <vadimcn@gmail.com>2016-12-07 18:05:20 -0800
committerVadim Chugunov <vadimcn@gmail.com>2016-12-07 18:05:20 -0800
commit6404143d8a36c9076cac89b3c386051b130f54c1 (patch)
treee3d0ac020d3cdb24f38636bc78d438fcf850476d /src
parentcc161225bd4ddf271a8c4fbc8bbe6ea3e7729f00 (diff)
Preserve inherited mode flags.
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/job.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bootstrap/job.rs b/src/bootstrap/job.rs
index b030538e979..c3859275e6f 100644
--- a/src/bootstrap/job.rs
+++ b/src/bootstrap/job.rs
@@ -123,7 +123,8 @@ pub unsafe fn setup() {
     // during startup or terminating abnormally).  This is important for running tests,
     // since some of them use abnormal termination by design.
     // This mode is inherited by all child processes.
-    SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
+    let mode = SetErrorMode(SEM_NOGPFAULTERRORBOX); // read inherited flags
+    SetErrorMode(mode | SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
 
     // Create a new job object for us to use
     let job = CreateJobObjectW(0 as *mut _, 0 as *const _);