From 70ef09a6953e9fac946a898ec2e562c87f16678c Mon Sep 17 00:00:00 2001 From: davidxu Date: Mon, 7 Jan 2008 02:26:29 +0000 Subject: sem_post() requires to return -1 on error. --- lib/libthr/thread/thr_sem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libthr') 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); } -- cgit v1.1