Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165679
b: refs/heads/master
c: dfe16df
h: refs/heads/master
i:
  165677: 20434df
  165675: 6d581f6
  165671: 7256f45
  165663: 543aa28
v: v3
  • Loading branch information
Vitaly Mayatskikh authored and Linus Torvalds committed Sep 24, 2009
1 parent 536c1c3 commit a7d320c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b6e763f07fba6243d2a553ed9a4f3e10a789932a
refs/heads/master: dfe16dfa4ac178d9a10b489a73d535c6976e48d2
49 changes: 23 additions & 26 deletions trunk/kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1645,32 +1645,6 @@ static long do_wait(struct wait_opts *wo)
end:
__set_current_state(TASK_RUNNING);
remove_wait_queue(&current->signal->wait_chldexit, &wo->child_wait);

if (wo->wo_info) {
struct siginfo __user *infop = wo->wo_info;

if (retval > 0)
retval = 0;
else {
/*
* For a WNOHANG return, clear out all the fields
* we would set so the user can easily tell the
* difference.
*/
if (!retval)
retval = put_user(0, &infop->si_signo);
if (!retval)
retval = put_user(0, &infop->si_errno);
if (!retval)
retval = put_user(0, &infop->si_code);
if (!retval)
retval = put_user(0, &infop->si_pid);
if (!retval)
retval = put_user(0, &infop->si_uid);
if (!retval)
retval = put_user(0, &infop->si_status);
}
}
return retval;
}

Expand Down Expand Up @@ -1715,6 +1689,29 @@ SYSCALL_DEFINE5(waitid, int, which, pid_t, upid, struct siginfo __user *,
wo.wo_stat = NULL;
wo.wo_rusage = ru;
ret = do_wait(&wo);

if (ret > 0) {
ret = 0;
} else if (infop) {
/*
* For a WNOHANG return, clear out all the fields
* we would set so the user can easily tell the
* difference.
*/
if (!ret)
ret = put_user(0, &infop->si_signo);
if (!ret)
ret = put_user(0, &infop->si_errno);
if (!ret)
ret = put_user(0, &infop->si_code);
if (!ret)
ret = put_user(0, &infop->si_pid);
if (!ret)
ret = put_user(0, &infop->si_uid);
if (!ret)
ret = put_user(0, &infop->si_status);
}

put_pid(pid);

/* avoid REGPARM breakage on x86: */
Expand Down

0 comments on commit a7d320c

Please sign in to comment.