From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 9C48B385840B; Tue, 1 Mar 2022 15:24:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C48B385840B Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: handle_sigprocmask: If new signal set is NULL, ignore "how" X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: 25937aa1d028325d88030ef3071a91a4e4905be8 X-Git-Newrev: c78f149733899f29f5881e290b4c3cd8c23c11ef Message-Id: <20220301152425.9C48B385840B@sourceware.org> Date: Tue, 1 Mar 2022 15:24:25 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2022 15:24:25 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Dc78f1497338= 99f29f5881e290b4c3cd8c23c11ef commit c78f149733899f29f5881e290b4c3cd8c23c11ef Author: Corinna Vinschen Date: Tue Mar 1 14:09:56 2022 +0100 Cygwin: handle_sigprocmask: If new signal set is NULL, ignore "how" =20 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: =20 "If set is a null pointer, the value of the argument how is not significant" =20 Signed-off-by: Corinna Vinschen 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 !=3D SIG_BLOCK && how !=3D SIG_UNBLOCK && how !=3D SIG_SETMASK) + /* check that how is in right range if set is not NULL */ + if (set && how !=3D SIG_BLOCK && how !=3D SIG_UNBLOCK && how !=3D SIG_SE= TMASK) { syscall_printf ("Invalid how value %d", how); return EINVAL; } =20 __try - { + { if (oldset) *oldset =3D opmask;