Skip to content

Commit

Permalink
sys/unix/process.rs: Clarify comment, per code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
geofft committed May 26, 2015
1 parent 15d62f6 commit 6a1ecbb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/libstd/sys/unix/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,12 @@ impl Process {
}

// Reset signal handling so the child process starts in a
// standardized state. We ignore SIGPIPE, and signal-handling
// libraries often set a mask; both of these get inherited,
// which most UNIX programs don't expect.
// standardized state. libstd ignores SIGPIPE, and signal-handling
// libraries often set a mask. Child processes inherit ignored
// signals and the signal mask from their parent, but most
// UNIX programs do not reset these things on their own, so we
// need to clean things up now to avoid confusing the program
// we're about to run.
let mut set: c::sigset_t = mem::uninitialized();
if c::sigemptyset(&mut set) != 0 ||
c::pthread_sigmask(c::SIG_SETMASK, &set, ptr::null_mut()) != 0 ||
Expand Down

0 comments on commit 6a1ecbb

Please sign in to comment.