diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-04-03 15:34:15 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-04-09 17:09:37 -0700 |
| commit | 33a2191d0b880242b3bf9a32477a6b432f931c80 (patch) | |
| tree | 1a03accf8685cbaeefdde4a93cdb70ea2532a71c /src/libstd/sys/unix/c.rs | |
| parent | d6c72306c8fc2ec0fd9d6e499c32f2bf52f0b8ba (diff) | |
| download | rust-33a2191d0b880242b3bf9a32477a6b432f931c80.tar.gz rust-33a2191d0b880242b3bf9a32477a6b432f931c80.zip | |
std: Clean up process spawn impl on unix
* De-indent quite a bit by removing usage of FnOnce closures
* Clearly separate code for the parent/child after the fork
* Use `fs2::{File, OpenOptions}` instead of calling `open` manually
* Use RAII to close I/O objects wherever possible
* Remove loop for closing all file descriptors, all our own ones are now
`CLOEXEC` by default so they cannot be inherited
Diffstat (limited to 'src/libstd/sys/unix/c.rs')
| -rw-r--r-- | src/libstd/sys/unix/c.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstd/sys/unix/c.rs b/src/libstd/sys/unix/c.rs index 282e5668e6e..aa4bf821207 100644 --- a/src/libstd/sys/unix/c.rs +++ b/src/libstd/sys/unix/c.rs @@ -159,6 +159,8 @@ extern { pub fn utimes(filename: *const libc::c_char, times: *const libc::timeval) -> libc::c_int; pub fn gai_strerror(errcode: libc::c_int) -> *const libc::c_char; + pub fn setgroups(ngroups: libc::c_int, + ptr: *const libc::c_void) -> libc::c_int; } #[cfg(any(target_os = "macos", target_os = "ios"))] |
