diff options
author | davidxu <davidxu@FreeBSD.org> | 2005-12-05 04:41:32 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2005-12-05 04:41:32 +0000 |
commit | 1e351478d411f60484993b6209a26619af7b89c7 (patch) | |
tree | 4dceee75fd59dab40fd606a1dbcb51c813ede560 /sys/kern/uipc_mqueue.c | |
parent | d4b584de18111c284e07f765ad260caf17ccfb79 (diff) | |
download | FreeBSD-src-1e351478d411f60484993b6209a26619af7b89c7.zip FreeBSD-src-1e351478d411f60484993b6209a26619af7b89c7.tar.gz |
After reading some documents, I realized SIGEV_NONE != NULL, also
fix code in mqueue_send_notification to handle SIGEV_NONE.
Diffstat (limited to 'sys/kern/uipc_mqueue.c')
-rw-r--r-- | sys/kern/uipc_mqueue.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/kern/uipc_mqueue.c b/sys/kern/uipc_mqueue.c index a5250fd..eb07a35 100644 --- a/sys/kern/uipc_mqueue.c +++ b/sys/kern/uipc_mqueue.c @@ -1694,11 +1694,13 @@ mqueue_send_notification(struct mqueue *mq) mtx_assert(&mq->mq_mutex, MA_OWNED); nt = mq->mq_notifier; - p = nt->nt_proc; - PROC_LOCK(p); - if (!KSI_ONQ(&nt->nt_ksi)) - psignal_event(p, &nt->nt_sigev, &nt->nt_ksi); - PROC_UNLOCK(p); + if (nt->nt_sigev.sigev_notify != SIGEV_NONE) { + p = nt->nt_proc; + PROC_LOCK(p); + if (!KSI_ONQ(&nt->nt_ksi)) + psignal_event(p, &nt->nt_sigev, &nt->nt_ksi); + PROC_UNLOCK(p); + } mq->mq_notifier = NULL; } @@ -2191,7 +2193,7 @@ again: if (uap->sigev != NULL) { if (mq->mq_notifier != NULL) { error = EBUSY; - } else if (ev.sigev_notify != SIGEV_NONE) { + } else { PROC_LOCK(p); nt = notifier_search(p, uap->mqd); if (nt == NULL) { |