Skip to content

Commit 6a1ecbb

Browse files
committed
sys/unix/process.rs: Clarify comment, per code review feedback
1 parent 15d62f6 commit 6a1ecbb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/libstd/sys/unix/process.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,12 @@ impl Process {
314314
}
315315

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

0 commit comments

Comments
 (0)