Skip to content

Commit a2526b4

Browse files
author
hyd-dev
committed
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.
1 parent 1d5a865 commit a2526b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/std/src/sys/unix/process/process_unix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl Command {
6767
// pipe I/O up to PIPE_BUF bytes should be atomic, and then
6868
// we want to be sure we *don't* run at_exit destructors as
6969
// we're being torn down regardless
70-
assert!(output.write(&bytes).is_ok());
70+
rtassert!(output.write(&bytes).is_ok());
7171
libc::_exit(1)
7272
}
7373
n => n,

0 commit comments

Comments
 (0)