public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: handle_sigprocmask: If new signal set is NULL, ignore "how"
Date: Tue,  1 Mar 2022 15:24:25 +0000 (GMT)	[thread overview]
Message-ID: <20220301152425.9C48B385840B@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=c78f149733899f29f5881e290b4c3cd8c23c11ef

commit c78f149733899f29f5881e290b4c3cd8c23c11ef
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;


                 reply	other threads:[~2022-03-01 15:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220301152425.9C48B385840B@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).