Skip to content

Commit 2a295c6

Browse files
committed
Run rustfmt on ptrace.rs
1 parent b04cb78 commit 2a295c6

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

Diff for: src/sys/ptrace.rs

+13-5
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,19 @@ type Word = usize;
188188
/// Makes the `PTRACE_SYSCALL` request to ptrace
189189
pub fn syscall(pid: Pid) -> Result<()> {
190190
unsafe {
191-
ptrace(ptrace::PTRACE_SYSCALL, pid, ptr::null_mut(), ptr::null_mut()).map(|_| ()) // ignore the useless return value
191+
ptrace(
192+
ptrace::PTRACE_SYSCALL,
193+
pid,
194+
ptr::null_mut(),
195+
ptr::null_mut(),
196+
).map(|_| ()) // ignore the useless return value
192197
}
193198
}
194199

195200
/// Makes the `PTRACE_PEEKUSER` request to ptrace
196201
pub fn peekuser(pid: Pid, reg: Register) -> Result<Word> {
197202
let reg_arg = (reg as i32) as *mut c_void;
198-
unsafe {
199-
ptrace(ptrace::PTRACE_PEEKUSER, pid, reg_arg, ptr::null_mut()).map(|r| r as Word)
200-
}
203+
unsafe { ptrace(ptrace::PTRACE_PEEKUSER, pid, reg_arg, ptr::null_mut()).map(|r| r as Word) }
201204
}
202205

203206
/// Makes the `PTRACE_POKEUSER` request to ptrace
@@ -228,7 +231,12 @@ pub fn traceme() -> Result<()> {
228231
/// This function allows to access arbitrary data in the traced process
229232
/// and may crash the inferior if used incorrectly and is thus marked `unsafe`.
230233
pub unsafe fn peekdata(pid: Pid, addr: usize) -> Result<Word> {
231-
ptrace(ptrace::PTRACE_PEEKDATA, pid, addr as *mut c_void, ptr::null_mut()).map(|r| r as Word)
234+
ptrace(
235+
ptrace::PTRACE_PEEKDATA,
236+
pid,
237+
addr as *mut c_void,
238+
ptr::null_mut(),
239+
).map(|r| r as Word)
232240
}
233241

234242
/// Makes the `PTRACE_POKEDATA` request to ptrace

0 commit comments

Comments
 (0)