summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2003-08-19 03:33:51 +0000
committerdavidxu <davidxu@FreeBSD.org>2003-08-19 03:33:51 +0000
commit0e9eb96aee533c5d7ded06ec0ee95d20190e7cc7 (patch)
treee47041de6cab5ad9f1cce9762c6f3a6691ba7b40 /lib/libpthread
parent55fc74037ce1fed2313813918c5380b1c642828e (diff)
downloadFreeBSD-src-0e9eb96aee533c5d7ded06ec0ee95d20190e7cc7.zip
FreeBSD-src-0e9eb96aee533c5d7ded06ec0ee95d20190e7cc7.tar.gz
Save and restore errno around sigprocmask.
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/thread/thr_fork.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libpthread/thread/thr_fork.c b/lib/libpthread/thread/thr_fork.c
index 6408fef..f640614 100644
--- a/lib/libpthread/thread/thr_fork.c
+++ b/lib/libpthread/thread/thr_fork.c
@@ -48,6 +48,7 @@ _fork(void)
sigset_t sigset, oldset;
struct pthread *curthread;
pid_t ret;
+ int errsave;
if (!_kse_isthreaded())
return (__sys_fork());
@@ -71,8 +72,11 @@ _fork(void)
_kse_single_thread(curthread);
/* Kernel signal mask is restored in _kse_single_thread */
} else {
- if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM)
+ if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) {
+ errsave = errno;
__sys_sigprocmask(SIG_SETMASK, &oldset, NULL);
+ errno = errsave;
+ }
}
/* Return the process ID: */
OpenPOWER on IntegriCloud