Skip to content

Commit

Permalink
Use rtassert! instead of assert! from the child process after for…
Browse files Browse the repository at this point in the history
…k() in std::sys::unix::process::Command::spawn()

`assert!` panics on failure, which is not signal-safe.
  • Loading branch information
hyd-dev committed Sep 29, 2020
1 parent 1d5a865 commit a2526b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/sys/unix/process/process_unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl Command {
// pipe I/O up to PIPE_BUF bytes should be atomic, and then
// we want to be sure we *don't* run at_exit destructors as
// we're being torn down regardless
assert!(output.write(&bytes).is_ok());
rtassert!(output.write(&bytes).is_ok());
libc::_exit(1)
}
n => n,
Expand Down

0 comments on commit a2526b4

Please sign in to comment.