From cdfde8c0d43f5b1e4231be5ae03e0a85e4f3d538 Mon Sep 17 00:00:00 2001 From: Paul Sajna <paulsajna@gmail.com> Date: Thu, 15 Mar 2018 11:55:37 -0700 Subject: [PATCH] more requested changes --- src/platform/src/redox/mod.rs | 4 ++-- tests/waitpid.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platform/src/redox/mod.rs b/src/platform/src/redox/mod.rs index 1fb185bb5..f63870866 100644 --- a/src/platform/src/redox/mod.rs +++ b/src/platform/src/redox/mod.rs @@ -205,8 +205,8 @@ pub fn unlink(path: *const c_char) -> c_int { pub fn waitpid(pid: pid_t, stat_loc: *mut c_int, options: c_int) -> pid_t { unsafe { let mut temp: usize = 0; - let mut res = e(syscall::waitpid(pid as usize, &mut temp, options as usize)); - if !stat_loc.is_null() { + let res = e(syscall::waitpid(pid as usize, &mut temp, options as usize)); + if !stat_loc.is_null() { *stat_loc = temp as c_int; } res diff --git a/tests/waitpid.c b/tests/waitpid.c index dc8fe52a6..79f982920 100644 --- a/tests/waitpid.c +++ b/tests/waitpid.c @@ -10,7 +10,7 @@ int main(int argc, char** argv) { exit(0); } else { // parent - int* stat_loc; - waitpid(pid, stat_loc, 0); + int stat_loc; + waitpid(pid, &stat_loc, 0); } } -- GitLab