Skip to content

Commit 91fa117

Browse files
Replace remaining process::exit with libc::_exit
Note that ptrace isn't documented as signal-safe, but it's supposed to just be a light syscall wrapper, so it should be fine.
1 parent f793d5f commit 91fa117

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/sys/test_wait.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,14 @@ mod ptrace {
4848
use nix::unistd::*;
4949
use nix::unistd::ForkResult::*;
5050
use std::{ptr, process};
51+
use libc::_exit;
5152

5253
fn ptrace_child() -> ! {
5354
let _ = ptrace(PTRACE_TRACEME, Pid::from_raw(0), ptr::null_mut(), ptr::null_mut());
5455
// As recommended by ptrace(2), raise SIGTRAP to pause the child
5556
// until the parent is ready to continue
5657
let _ = raise(SIGTRAP);
57-
process::exit(0)
58+
unsafe { _exit(0) }
5859
}
5960

6061
fn ptrace_parent(child: Pid) {

0 commit comments

Comments
 (0)