diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-08-20 16:26:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-20 16:26:41 +0200 |
| commit | 3662a9fb0476f5d4209ef2471b33ce4199e01fbe (patch) | |
| tree | 46072ae0149e6e85749ab33dc76783fbb69e54e7 /src/libstd/sys/unix/process/process_unix.rs | |
| parent | af77aedb0e895cd169614f86e59ff9f84c09f7a0 (diff) | |
| parent | 8e91dca596fcbab866a64f9502c476dff5bb06f6 (diff) | |
| download | rust-3662a9fb0476f5d4209ef2471b33ce4199e01fbe.tar.gz rust-3662a9fb0476f5d4209ef2471b33ce4199e01fbe.zip | |
Rollup merge of #63723 - josephlr:sigemptyset, r=alexcrichton
Consolidate sigemptyset workarounds In sys/unix/process, we work around the sigemptyset linking issues on android in two different ways. This change consolidates these workarounds, and avoids duplicating bindings from `libc`.
Diffstat (limited to 'src/libstd/sys/unix/process/process_unix.rs')
| -rw-r--r-- | src/libstd/sys/unix/process/process_unix.rs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/libstd/sys/unix/process/process_unix.rs b/src/libstd/sys/unix/process/process_unix.rs index 327d82e60cf..a9711c71b7a 100644 --- a/src/libstd/sys/unix/process/process_unix.rs +++ b/src/libstd/sys/unix/process/process_unix.rs @@ -214,14 +214,7 @@ impl Command { // need to clean things up now to avoid confusing the program // we're about to run. let mut set = MaybeUninit::<libc::sigset_t>::uninit(); - if cfg!(target_os = "android") { - // Implementing sigemptyset allow us to support older Android - // versions. See the comment about Android and sig* functions in - // process_common.rs - set.as_mut_ptr().write_bytes(0u8, 1); - } else { - cvt(libc::sigemptyset(set.as_mut_ptr()))?; - } + cvt(sigemptyset(set.as_mut_ptr()))?; cvt(libc::pthread_sigmask(libc::SIG_SETMASK, set.as_ptr(), ptr::null_mut()))?; let ret = sys::signal(libc::SIGPIPE, libc::SIG_DFL); @@ -363,10 +356,10 @@ impl Command { } let mut set = MaybeUninit::<libc::sigset_t>::uninit(); - cvt(libc::sigemptyset(set.as_mut_ptr()))?; + cvt(sigemptyset(set.as_mut_ptr()))?; cvt(libc::posix_spawnattr_setsigmask(attrs.0.as_mut_ptr(), set.as_ptr()))?; - cvt(libc::sigaddset(set.as_mut_ptr(), libc::SIGPIPE))?; + cvt(sigaddset(set.as_mut_ptr(), libc::SIGPIPE))?; cvt(libc::posix_spawnattr_setsigdefault(attrs.0.as_mut_ptr(), set.as_ptr()))?; |
