summaryrefslogtreecommitdiffstats
path: root/lib/libthr
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2006-12-12 05:26:39 +0000
committerdavidxu <davidxu@FreeBSD.org>2006-12-12 05:26:39 +0000
commit229aca463476a9878d74ca11a5da7fd114f5b18e (patch)
tree89e2185ae7087e07ec0720298c48ccca14b784cf /lib/libthr
parentfec8d2cf34e67f0b3928b1d0e160fa9cda4ab1fc (diff)
downloadFreeBSD-src-229aca463476a9878d74ca11a5da7fd114f5b18e.zip
FreeBSD-src-229aca463476a9878d74ca11a5da7fd114f5b18e.tar.gz
Correctly check failed syscall.
Diffstat (limited to 'lib/libthr')
-rw-r--r--lib/libthr/thread/thr_umtx.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/libthr/thread/thr_umtx.c b/lib/libthr/thread/thr_umtx.c
index 9de346e..0a5ee6a 100644
--- a/lib/libthr/thread/thr_umtx.c
+++ b/lib/libthr/thread/thr_umtx.c
@@ -41,7 +41,7 @@ _thr_umutex_init(struct umutex *mtx)
int
__thr_umutex_lock(struct umutex *mtx)
{
- if (_umtx_op(mtx, UMTX_OP_MUTEX_LOCK, 0, 0, 0) == 0)
+ if (_umtx_op(mtx, UMTX_OP_MUTEX_LOCK, 0, 0, 0) != -1)
return 0;
return (errno);
}
@@ -54,7 +54,7 @@ __thr_umutex_timedlock(struct umutex *mtx,
timeout->tv_nsec <= 0)))
return (ETIMEDOUT);
if (_umtx_op(mtx, UMTX_OP_MUTEX_LOCK, 0, 0,
- __DECONST(void *, timeout)) == 0)
+ __DECONST(void *, timeout)) != -1)
return (0);
return (errno);
}
@@ -62,7 +62,7 @@ __thr_umutex_timedlock(struct umutex *mtx,
int
__thr_umutex_unlock(struct umutex *mtx)
{
- if (_umtx_op(mtx, UMTX_OP_MUTEX_UNLOCK, 0, 0, 0) == 0)
+ if (_umtx_op(mtx, UMTX_OP_MUTEX_UNLOCK, 0, 0, 0) != -1)
return (0);
return (errno);
}
@@ -70,7 +70,7 @@ __thr_umutex_unlock(struct umutex *mtx)
int
__thr_umutex_trylock(struct umutex *mtx)
{
- if (_umtx_op(mtx, UMTX_OP_MUTEX_TRYLOCK, 0, 0, 0) == 0)
+ if (_umtx_op(mtx, UMTX_OP_MUTEX_TRYLOCK, 0, 0, 0) != -1)
return (0);
return (errno);
}
@@ -79,7 +79,7 @@ int
__thr_umutex_set_ceiling(struct umutex *mtx, uint32_t ceiling,
uint32_t *oldceiling)
{
- if (_umtx_op(mtx, UMTX_OP_SET_CEILING, ceiling, oldceiling, 0) == 0)
+ if (_umtx_op(mtx, UMTX_OP_SET_CEILING, ceiling, oldceiling, 0) != -1)
return (0);
return (errno);
}
@@ -91,7 +91,7 @@ _thr_umtx_wait(volatile umtx_t *mtx, long id, const struct timespec *timeout)
timeout->tv_nsec <= 0)))
return (ETIMEDOUT);
if (_umtx_op(__DEVOLATILE(void *, mtx), UMTX_OP_WAIT, id, 0,
- __DECONST(void*, timeout)) == 0)
+ __DECONST(void*, timeout)) != -1)
return (0);
return (errno);
}
@@ -100,7 +100,7 @@ int
_thr_umtx_wake(volatile umtx_t *mtx, int nr_wakeup)
{
if (_umtx_op(__DEVOLATILE(void *, mtx), UMTX_OP_WAKE,
- nr_wakeup, 0, 0) == 0)
+ nr_wakeup, 0, 0) != -1)
return (0);
return (errno);
}
@@ -122,7 +122,7 @@ _thr_ucond_wait(struct ucond *cv, struct umutex *m,
}
if (_umtx_op(cv, UMTX_OP_CV_WAIT,
check_unparking ? UMTX_CHECK_UNPARKING : 0,
- m, __DECONST(void*, timeout)) == 0) {
+ m, __DECONST(void*, timeout)) != -1) {
return (0);
}
return (errno);
@@ -133,7 +133,7 @@ _thr_ucond_signal(struct ucond *cv)
{
if (!cv->c_has_waiters)
return (0);
- if (_umtx_op(cv, UMTX_OP_CV_SIGNAL, 0, NULL, NULL) == 0)
+ if (_umtx_op(cv, UMTX_OP_CV_SIGNAL, 0, NULL, NULL) != -1)
return (0);
return (errno);
}
@@ -143,7 +143,7 @@ _thr_ucond_broadcast(struct ucond *cv)
{
if (!cv->c_has_waiters)
return (0);
- if (_umtx_op(cv, UMTX_OP_CV_BROADCAST, 0, NULL, NULL) == 0)
+ if (_umtx_op(cv, UMTX_OP_CV_BROADCAST, 0, NULL, NULL) != -1)
return (0);
return (errno);
}
OpenPOWER on IntegriCloud