Skip to content

Commit 59c18e2

Browse files
Fix test_ptrace_syscall() on x32
Based on #1384 (comment)
1 parent f13f57a commit 59c18e2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/sys/test_ptrace.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ fn test_ptrace_cont() {
100100
ptrace::cont(child, Some(Signal::SIGKILL)).unwrap();
101101
match waitpid(child, None) {
102102
Ok(WaitStatus::Signaled(pid, Signal::SIGKILL, _)) if pid == child => {
103-
// FIXME It's been observed on some systems (apple) the
103+
// FIXME It's been observed on some systems (apple) the
104104
// tracee may not be killed but remain as a zombie process
105105
// affecting other wait based tests. Add an extra kill just
106106
// to make sure there are no zombies.
@@ -150,11 +150,11 @@ fn test_ptrace_syscall() {
150150
// set this option to recognize syscall-stops
151151
ptrace::setoptions(child, ptrace::Options::PTRACE_O_TRACESYSGOOD).unwrap();
152152

153-
#[cfg(target_pointer_width = "64")]
154-
let get_syscall_id = || ptrace::getregs(child).unwrap().orig_rax as i64;
153+
#[cfg(target_arch = "x86_64")]
154+
let get_syscall_id = || ptrace::getregs(child).unwrap().orig_rax as libc::c_long;
155155

156-
#[cfg(target_pointer_width = "32")]
157-
let get_syscall_id = || ptrace::getregs(child).unwrap().orig_eax as i32;
156+
#[cfg(target_arch = "x86")]
157+
let get_syscall_id = || ptrace::getregs(child).unwrap().orig_eax as libc::c_long;
158158

159159
// kill entry
160160
ptrace::syscall(child, None).unwrap();

0 commit comments

Comments
 (0)