Skip to content
Snippets Groups Projects
Commit cdfde8c0 authored by Paul Sajna's avatar Paul Sajna
Browse files

more requested changes

parent 52acce0d
No related branches found
No related tags found
1 merge request!74wait and waitpid
......@@ -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
......
......@@ -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);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment