Use `rtassert!` instead of `assert!` from the child process after fork() in std::sys::unix::process::Command::spawn()

`assert!` panics on failure, which is not signal-safe.
This commit is contained in:
hyd-dev 2020-09-29 15:16:46 +08:00
parent 1d5a865b2f
commit a2526b416f
No known key found for this signature in database
GPG Key ID: 74FA7FD5B8DA14B8
1 changed files with 1 additions and 1 deletions

View File

@ -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,