summaryrefslogtreecommitdiff
path: root/lib/libpthread/uthread
diff options
context:
space:
mode:
authorKurt Miller <kurt@cvs.openbsd.org>2008-04-24 03:31:34 +0000
committerKurt Miller <kurt@cvs.openbsd.org>2008-04-24 03:31:34 +0000
commit6b2473c027f24edba1bdd64ff89b13bec40a3365 (patch)
tree37e5df3188b3e5bb43236a379e95e6aa30172947 /lib/libpthread/uthread
parente75ab05ae705cdd8919929a6c26af36867ca408a (diff)
Return the proper values upon failure per POSIX for pthread_sigmask(3) and
sigprocmask(2) in threaded programs. From Philip Guenther <guenther at sendmail.com> via PR library/5795. okay marc@
Diffstat (limited to 'lib/libpthread/uthread')
-rw-r--r--lib/libpthread/uthread/uthread_sigmask.c5
-rw-r--r--lib/libpthread/uthread/uthread_sigprocmask.c12
2 files changed, 12 insertions, 5 deletions
diff --git a/lib/libpthread/uthread/uthread_sigmask.c b/lib/libpthread/uthread/uthread_sigmask.c
index 04634a8855d..b33227e2aed 100644
--- a/lib/libpthread/uthread/uthread_sigmask.c
+++ b/lib/libpthread/uthread/uthread_sigmask.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_sigmask.c,v 1.7 2003/07/08 00:17:19 marc Exp $ */
+/* $OpenBSD: uthread_sigmask.c,v 1.8 2008/04/24 03:31:33 kurt Exp $ */
/*
* Copyright (c) 1997 John Birrell <jb@cimlogic.com.au>.
* All rights reserved.
@@ -75,8 +75,7 @@ pthread_sigmask(int how, const sigset_t *set, sigset_t *oset)
/* Trap invalid actions: */
default:
/* Return an invalid argument: */
- errno = EINVAL;
- ret = -1;
+ ret = EINVAL;
break;
}
diff --git a/lib/libpthread/uthread/uthread_sigprocmask.c b/lib/libpthread/uthread/uthread_sigprocmask.c
index ebe56d899b6..658fe84cd9b 100644
--- a/lib/libpthread/uthread/uthread_sigprocmask.c
+++ b/lib/libpthread/uthread/uthread_sigprocmask.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_sigprocmask.c,v 1.4 2001/12/30 01:11:07 fgsch Exp $ */
+/* $OpenBSD: uthread_sigprocmask.c,v 1.5 2008/04/24 03:31:33 kurt Exp $ */
/*
* Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>.
* All rights reserved.
@@ -41,6 +41,14 @@
int
sigprocmask(int how, const sigset_t *set, sigset_t *oset)
{
- return (pthread_sigmask(how, set, oset));
+ int ret;
+
+ ret = pthread_sigmask(how, set, oset);
+ if (ret != 0)
+ {
+ errno = ret;
+ ret = -1;
+ }
+ return ret;
}
#endif