Skip to content

Commit 0657990

Browse files
committed
fix linux conversion
1 parent 795e246 commit 0657990

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

crates/fspy_preload_unix/src/interceptions/linux_syscall.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ unsafe extern "C" fn syscall(syscall_no: c_long, mut args: ...) -> c_long {
1818

1919
match syscall_no {
2020
libc::SYS_statx => {
21-
dbg!((a0, a1));
22-
if let Ok(dirfd) = c_int::try_from(a0) {
23-
let pathname = a1 as *const c_char;
24-
unsafe {
25-
handle_open(PathAt(dirfd, pathname), AccessMode::Read);
26-
}
21+
// c-style conversion is expected: (4294967196 -> -100 aka libc::AT_FDCWD)
22+
let dirfd = a0 as c_int;
23+
let pathname = a1 as *const c_char;
24+
unsafe {
25+
handle_open(PathAt(dirfd, pathname), AccessMode::Read);
2726
}
2827
}
2928
_ => {}

0 commit comments

Comments
 (0)