about summary refs log tree commit diff
path: root/src/libstd/sys/windows
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-03-07 21:59:15 +0000
committerbors <bors@rust-lang.org>2018-03-07 21:59:15 +0000
commit5430c0c5c0fbdfb8e89358a187d2f9a8d4b796d4 (patch)
tree99f6ed796a60eef5a806809bd02146d3463ddf0b /src/libstd/sys/windows
parent4cdbac639af2074b8a07b4391b4e3e28b4118487 (diff)
parent16cc9ce8a27eac42950d8413f46c648e35e10cb3 (diff)
downloadrust-5430c0c5c0fbdfb8e89358a187d2f9a8d4b796d4.tar.gz
rust-5430c0c5c0fbdfb8e89358a187d2f9a8d4b796d4.zip
Auto merge of #48806 - alexcrichton:rollup, r=alexcrichton
Rollup of 9 pull requests

- Successful merges: #48511, #48549, #48618, #48624, #48651, #48698, #48778, #48787, #48802
- Failed merges: #48669, #48710
Diffstat (limited to 'src/libstd/sys/windows')
-rw-r--r--src/libstd/sys/windows/process.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs
index c93179869a6..f1ab9c47609 100644
--- a/src/libstd/sys/windows/process.rs
+++ b/src/libstd/sys/windows/process.rs
@@ -18,7 +18,7 @@ use ffi::{OsString, OsStr};
 use fmt;
 use fs;
 use io::{self, Error, ErrorKind};
-use libc::c_void;
+use libc::{c_void, EXIT_SUCCESS, EXIT_FAILURE};
 use mem;
 use os::windows::ffi::OsStrExt;
 use path::Path;
@@ -408,6 +408,18 @@ impl fmt::Display for ExitStatus {
     }
 }
 
+#[derive(PartialEq, Eq, Clone, Copy, Debug)]
+pub struct ExitCode(c::DWORD);
+
+impl ExitCode {
+    pub const SUCCESS: ExitCode = ExitCode(EXIT_SUCCESS as _);
+    pub const FAILURE: ExitCode = ExitCode(EXIT_FAILURE as _);
+
+    pub fn as_i32(&self) -> i32 {
+        self.0 as i32
+    }
+}
+
 fn zeroed_startupinfo() -> c::STARTUPINFO {
     c::STARTUPINFO {
         cb: 0,