public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin/cygwin-3_3-branch] Cygwin: handle_sigprocmask: If new signal set is NULL, ignore "how"
@ 2022-03-01 15:24 Corinna Vinschen
0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2022-03-01 15:24 UTC (permalink / raw)
To: cygwin-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=4ee19860bd0b926528dd4d8624f43cb87a76273d
commit 4ee19860bd0b926528dd4d8624f43cb87a76273d
Author: Corinna Vinschen <corinna@vinschen.de>
Date: Tue Mar 1 14:09:56 2022 +0100
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>
Diff:
---
winsup/cygwin/signal.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc
index 2cf750f5c..9b6c2509d 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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-01 15:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-01 15:24 [newlib-cygwin/cygwin-3_3-branch] Cygwin: handle_sigprocmask: If new signal set is NULL, ignore "how" Corinna Vinschen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).