diff options
| author | Marco A L Barbosa <malbarbo@gmail.com> | 2017-03-25 17:15:26 -0300 |
|---|---|---|
| committer | Marco A L Barbosa <malbarbo@gmail.com> | 2017-03-25 17:15:26 -0300 |
| commit | 24be89980e2e89404075fe463edae0f5db369251 (patch) | |
| tree | 9ffba5beb97597bbf80ece0d8dba103690e5cad7 /src/libstd/sys/unix/process/process_unix.rs | |
| parent | b45c631382a0bb831dc038973288e3f6d91cb07a (diff) | |
| download | rust-24be89980e2e89404075fe463edae0f5db369251.tar.gz rust-24be89980e2e89404075fe463edae0f5db369251.zip | |
Avoid using libc::sigemptyset on Android
Diffstat (limited to 'src/libstd/sys/unix/process/process_unix.rs')
| -rw-r--r-- | src/libstd/sys/unix/process/process_unix.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libstd/sys/unix/process/process_unix.rs b/src/libstd/sys/unix/process/process_unix.rs index a213273aac8..edd322ca6fa 100644 --- a/src/libstd/sys/unix/process/process_unix.rs +++ b/src/libstd/sys/unix/process/process_unix.rs @@ -193,7 +193,16 @@ impl Command { // need to clean things up now to avoid confusing the program // we're about to run. let mut set: libc::sigset_t = mem::uninitialized(); - t!(cvt(libc::sigemptyset(&mut set))); + 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 + libc::memset(&mut set as *mut _ as *mut _, + 0, + mem::size_of::<libc::sigset_t>()); + } else { + t!(cvt(libc::sigemptyset(&mut set))); + } t!(cvt(libc::pthread_sigmask(libc::SIG_SETMASK, &set, ptr::null_mut()))); let ret = sys::signal(libc::SIGPIPE, libc::SIG_DFL); |
