diff options
author | dim <dim@FreeBSD.org> | 2015-01-29 19:21:21 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-01-29 19:21:21 +0000 |
commit | 1d69d7d4596d0dd39aa58fafb5c376b38bf90686 (patch) | |
tree | e6a581ee2a3f86081f45870ee2913c5435c1e35d /lib/libc | |
parent | f7ab48b7ad07f9fa3eeb9fdd2577baf4f45259d8 (diff) | |
download | FreeBSD-src-1d69d7d4596d0dd39aa58fafb5c376b38bf90686.zip FreeBSD-src-1d69d7d4596d0dd39aa58fafb5c376b38bf90686.tar.gz |
Merge ^/head r277861 through r277895.
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/sem_new.c | 6 | ||||
-rw-r--r-- | lib/libc/gen/sem_post.3 | 5 | ||||
-rw-r--r-- | lib/libc/mips/gen/sigsetjmp.S | 2 |
3 files changed, 9 insertions, 4 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); diff --git a/lib/libc/gen/sem_post.3 b/lib/libc/gen/sem_post.3 index 485d2fc..dea8eb6 100644 --- a/lib/libc/gen/sem_post.3 +++ b/lib/libc/gen/sem_post.3 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2000 +.Dd January 28, 2015 .Dt SEM_POST 3 .Os .Sh NAME @@ -65,6 +65,9 @@ The .Fa sem argument points to an invalid semaphore. +.It Bq Er EOVERFLOW +The semaphore value would exceed +.Dv SEM_VALUE_MAX . .El .Sh SEE ALSO .Xr sem_getvalue 3 , diff --git a/lib/libc/mips/gen/sigsetjmp.S b/lib/libc/mips/gen/sigsetjmp.S index 7705c29..41c47f2 100644 --- a/lib/libc/mips/gen/sigsetjmp.S +++ b/lib/libc/mips/gen/sigsetjmp.S @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); LEAF(sigsetjmp) PIC_PROLOGUE(sigsetjmp) - bne a1, 0x0, 1f # do saving of signal mask? + bne a1, zero, 1f # do saving of signal mask? PIC_TAILCALL(_setjmp) 1: PIC_TAILCALL(setjmp) |