diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2022-03-01 14:09:56 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2022-03-01 16:23:24 +0100 |
commit | c78f149733899f29f5881e290b4c3cd8c23c11ef (patch) | |
tree | c243a941309c8ddcb574e50bcf812ed1a801690b | |
parent | 25937aa1d028325d88030ef3071a91a4e4905be8 (diff) | |
download | newlib-c78f149733899f29f5881e290b4c3cd8c23c11ef.zip newlib-c78f149733899f29f5881e290b4c3cd8c23c11ef.tar.gz newlib-c78f149733899f29f5881e290b4c3cd8c23c11ef.tar.bz2 |
Cygwin: handle_sigprocmask: If new signal set is NULL, ignore "how"
The "how" value only makes sense if a new set is given. If we
only read the current signal set, ignore the value of "how" per
POSIX:
"If set is a null pointer, the value of the argument how is not
significant"
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r-- | winsup/cygwin/signal.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc index 2cf750f..9b6c250 100644 --- a/winsup/cygwin/signal.cc +++ b/winsup/cygwin/signal.cc @@ -205,15 +205,15 @@ sigprocmask (int how, const sigset_t *set, sigset_t *oldset) int __reg3 handle_sigprocmask (int how, const sigset_t *set, sigset_t *oldset, sigset_t& opmask) { - /* check that how is in right range */ - if (how != SIG_BLOCK && how != SIG_UNBLOCK && how != SIG_SETMASK) + /* check that how is in right range if set is not NULL */ + if (set && how != SIG_BLOCK && how != SIG_UNBLOCK && how != SIG_SETMASK) { syscall_printf ("Invalid how value %d", how); return EINVAL; } __try - { + { if (oldset) *oldset = opmask; |