From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 82F663858423; Tue, 1 Mar 2022 15:24:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 82F663858423 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-3_3-branch] 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/cygwin-3_3-branch X-Git-Oldrev: bf815ee399d98f7453a09b8fecdfdeb9c954fe4f X-Git-Newrev: 4ee19860bd0b926528dd4d8624f43cb87a76273d Message-Id: <20220301152410.82F663858423@sourceware.org> Date: Tue, 1 Mar 2022 15:24:10 +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:10 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D4ee19860bd0= b926528dd4d8624f43cb87a76273d commit 4ee19860bd0b926528dd4d8624f43cb87a76273d 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;