|
@@ -1645,32 +1645,6 @@ notask:
|
|
end:
|
|
end:
|
|
__set_current_state(TASK_RUNNING);
|
|
__set_current_state(TASK_RUNNING);
|
|
remove_wait_queue(¤t->signal->wait_chldexit, &wo->child_wait);
|
|
remove_wait_queue(¤t->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;
|
|
return retval;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1715,6 +1689,29 @@ SYSCALL_DEFINE5(waitid, int, which, pid_t, upid, struct siginfo __user *,
|
|
wo.wo_stat = NULL;
|
|
wo.wo_stat = NULL;
|
|
wo.wo_rusage = ru;
|
|
wo.wo_rusage = ru;
|
|
ret = do_wait(&wo);
|
|
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);
|
|
put_pid(pid);
|
|
|
|
|
|
/* avoid REGPARM breakage on x86: */
|
|
/* avoid REGPARM breakage on x86: */
|