summaryrefslogtreecommitdiffstats
path: root/lib/libthr
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2008-01-07 02:26:29 +0000
committerdavidxu <davidxu@FreeBSD.org>2008-01-07 02:26:29 +0000
commit70ef09a6953e9fac946a898ec2e562c87f16678c (patch)
tree00d5e2766040c896d9329fad9b9b8cb56d3ac1c0 /lib/libthr
parent6b59f7502038ec82b37976e254d33b07f80e2f8b (diff)
downloadFreeBSD-src-70ef09a6953e9fac946a898ec2e562c87f16678c.zip
FreeBSD-src-70ef09a6953e9fac946a898ec2e562c87f16678c.tar.gz
sem_post() requires to return -1 on error.
Diffstat (limited to 'lib/libthr')
-rw-r--r--lib/libthr/thread/thr_sem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libthr/thread/thr_sem.c b/lib/libthr/thread/thr_sem.c
index ec059f9..6a0bfc1 100644
--- a/lib/libthr/thread/thr_sem.c
+++ b/lib/libthr/thread/thr_sem.c
@@ -282,8 +282,8 @@ _sem_post(sem_t *sem)
if ((*sem)->nwaiters) {
retval = _thr_umtx_wake(&(*sem)->count, 1);
- if (retval > 0)
- retval = 0;
+ if (retval != 0)
+ retval = -1;
}
return (retval);
}
OpenPOWER on IntegriCloud