summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/sem_new.c
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2015-05-27 01:19:58 +0000
committersjg <sjg@FreeBSD.org>2015-05-27 01:19:58 +0000
commit65145fa4c81da358fcbc3b650156dab705dfa34e (patch)
tree55c065b6730aaac2afb6c29933ee6ec5fa4c4249 /lib/libc/gen/sem_new.c
parent60ff4eb0dff94a04d75d0d52a3957aaaf5f8c693 (diff)
parente6b664c390af88d4a87208bc042ce503da664c3b (diff)
downloadFreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.zip
FreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.tar.gz
Merge sync of head
Diffstat (limited to 'lib/libc/gen/sem_new.c')
-rw-r--r--lib/libc/gen/sem_new.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/gen/sem_new.c b/lib/libc/gen/sem_new.c
index 3ee0272..c5dc7e7 100644
--- a/lib/libc/gen/sem_new.c
+++ b/lib/libc/gen/sem_new.c
@@ -439,8 +439,10 @@ _sem_post(sem_t *sem)
do {
count = sem->_kern._count;
- if (USEM_COUNT(count) + 1 > SEM_VALUE_MAX)
- return (EOVERFLOW);
+ if (USEM_COUNT(count) + 1 > SEM_VALUE_MAX) {
+ errno = EOVERFLOW;
+ return (-1);
+ }
} while (!atomic_cmpset_rel_int(&sem->_kern._count, count, count + 1));
if (count & USEM_HAS_WAITERS)
usem_wake(&sem->_kern);
OpenPOWER on IntegriCloud