diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2001-12-30 01:11:08 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2001-12-30 01:11:08 +0000 |
commit | 7e346e84b87df608be63c0994fdebc1f87c03830 (patch) | |
tree | adbb9aeac7a3c7674f47c1d45ec3dab8443f5b3c /lib/libpthread/uthread | |
parent | b245e1db73355d2600f6110c562332da1f16281f (diff) |
call pthread_sigmask() instead of having the code twice.
Diffstat (limited to 'lib/libpthread/uthread')
-rw-r--r-- | lib/libpthread/uthread/uthread_sigprocmask.c | 50 |
1 files changed, 3 insertions, 47 deletions
diff --git a/lib/libpthread/uthread/uthread_sigprocmask.c b/lib/libpthread/uthread/uthread_sigprocmask.c index 28d4c3b1efe..ebe56d899b6 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.3 1999/11/25 07:01:45 d Exp $ */ +/* $OpenBSD: uthread_sigprocmask.c,v 1.4 2001/12/30 01:11:07 fgsch Exp $ */ /* * Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>. * All rights reserved. @@ -39,52 +39,8 @@ #include "pthread_private.h" int -sigprocmask(int how, const sigset_t * set, sigset_t * oset) +sigprocmask(int how, const sigset_t *set, sigset_t *oset) { - int ret = 0; - - /* Check if the existing signal process mask is to be returned: */ - if (oset != NULL) { - /* Return the current mask: */ - *oset = _thread_run->sigmask; - } - /* Check if a new signal set was provided by the caller: */ - if (set != NULL) { - /* Process according to what to do: */ - switch (how) { - /* Block signals: */ - case SIG_BLOCK: - /* Add signals to the existing mask: */ - _thread_run->sigmask |= *set; - break; - - /* Unblock signals: */ - case SIG_UNBLOCK: - /* Clear signals from the existing mask: */ - _thread_run->sigmask &= ~(*set); - break; - - /* Set the signal process mask: */ - case SIG_SETMASK: - /* Set the new mask: */ - _thread_run->sigmask = *set; - break; - - /* Trap invalid actions: */ - default: - /* Return an invalid argument: */ - errno = EINVAL; - ret = -1; - break; - } - - /* - * Dispatch signals to the running thread that are pending - * and now unblocked: - */ - _dispatch_signals(); - } - /* Return the completion status: */ - return (ret); + return (pthread_sigmask(how, set, oset)); } #endif |