[PATCH 3/5] Use copy_wait_opts_to_user() in do_wait()

Vitaly Mayatskikh
2009-05-11T13:28:14Z

All copy-paste getrusage() and put_user() code in wait_task_* functions
is replaced by call to copy_wait_opts_to_user()

Use copy_wait_opts_to_user() in do_wait() to clean up user's siginfo structure.

Signed-off-by: Vitaly Mayatskikh <v.mayatskih@gmail.com>
---
kernel/exit.c | 15 +--------------
1 files changed, 1 insertions(+), 14 deletions(-)

diff --git a/kernel/exit.c b/kernel/exit.c
index 0bf2d3c..a742ae9 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1600,8 +1600,6 @@ end:
__set_current_state(TASK_RUNNING);
remove_wait_queue(&current->signal->wait_chldexit,&wait);
if (wo->wo_info) {
- struct siginfo __user *infop = wo->wo_info;
-
if (retval > 0)
retval = 0;
else {
@@ -1610,18 +1608,7 @@ end:
* 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);
+ retval = copy_wait_opts_to_user(wo, 0, 0, 0, 0, 0, 0);
}
}
return retval;
--
1.6.2.2