summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2004-06-07 13:35:02 +0000
committerDavid Xu <davidxu@FreeBSD.org>2004-06-07 13:35:02 +0000
commit36939a0a5cbfb8cf975a26766a51ca1ca0ea9250 (patch)
tree56eb99ef1aab3040c2a84f434732d801a331bf6d
parent0e11f0a93b301f7cf608ac6cc80f77fa75314bdb (diff)
Notes
-rw-r--r--sys/kern/kern_sig.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index adda9bdb4e89..81f5bbb5a7ba 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -746,12 +746,18 @@ sigwait(struct thread *td, struct sigwait_args *uap)
int error;
error = copyin(uap->set, &set, sizeof(set));
- if (error)
- return (error);
+ if (error) {
+ td->td_retval[0] = error;
+ return (0);
+ }
error = kern_sigtimedwait(td, set, &info, NULL);
- if (error)
- return (error);
+ if (error) {
+ if (error == ERESTART)
+ return (error);
+ td->td_retval[0] = error;
+ return (0);
+ }
error = copyout(&info.si_signo, uap->sig, sizeof(info.si_signo));
/* Repost if we got an error. */
@@ -760,7 +766,8 @@ sigwait(struct thread *td, struct sigwait_args *uap)
tdsignal(td, info.si_signo, SIGTARGET_TD);
PROC_UNLOCK(td->td_proc);
}
- return (error);
+ td->td_retval[0] = error;
+ return (0);
}
/*
* MPSAFE