diff options
| author | kamil <kamil@NetBSD.org> | 2020-01-14 18:18:59 +0000 |
|---|---|---|
| committer | kamil <kamil@NetBSD.org> | 2020-01-14 18:18:59 +0000 |
| commit | cdab1739f9a7e9c5d1663d1961f1e24072f4f835 (patch) | |
| tree | d759db19167da73e9722570f80bb497a08e51b2e /lib/libc | |
| parent | e11da038557289923e25124ba0067f3b77a7d624 (diff) | |
Adjust the error return value of pthread_sigmask for !libpthread usage
Instead of returning -1, return errno on error.
Catch up after the fix in libpthread by Andrew Doran in 2008
in lib/libpthread/pthread_misc.c r.1.9.
It's an open question whether this function shall be used without linked
in the POSIX thread library.
Detected by Bruno Haible (GNU) and documented in gnulib in commit
"pthread_sigmask: Avoid test failure on NetBSD 8.0. " r. 4d16a83b0c1fcb6c.
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/thread-stub/thread-stub.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libc/thread-stub/thread-stub.c b/lib/libc/thread-stub/thread-stub.c index c89fafbedee..93b20e03281 100644 --- a/lib/libc/thread-stub/thread-stub.c +++ b/lib/libc/thread-stub/thread-stub.c @@ -1,4 +1,4 @@ -/* $NetBSD: thread-stub.c,v 1.29 2019/03/05 01:35:52 christos Exp $ */ +/* $NetBSD: thread-stub.c,v 1.30 2020/01/14 18:18:59 kamil Exp $ */ /*- * Copyright (c) 2003, 2009 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: thread-stub.c,v 1.29 2019/03/05 01:35:52 christos Exp $"); +__RCSID("$NetBSD: thread-stub.c,v 1.30 2020/01/14 18:18:59 kamil Exp $"); #endif /* LIBC_SCCS and not lint */ /* @@ -382,7 +382,9 @@ __libc_thr_sigsetmask_stub(int h, const sigset_t *s, sigset_t *o) CHECK_NOT_THREADED(); - return sigprocmask(h, s, o); + if (sigprocmask(h, s, o)) + return errno; + return 0; } thr_t |
