From patchwork Tue Dec 10 18:32:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 181146 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp6241679ile; Tue, 10 Dec 2019 10:32:58 -0800 (PST) X-Google-Smtp-Source: APXvYqz2r6acWwRz1lQRi/+dl80mQWrGICyxnmY/0qgHPVqBHsZ/9cknFx5r8gvNY+YyYAeDj7u1 X-Received: by 2002:a9d:5c84:: with SMTP id a4mr15623528oti.305.1576002778785; Tue, 10 Dec 2019 10:32:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576002778; cv=none; d=google.com; s=arc-20160816; b=gOMyHxD3SavBbTXsZ4WHYFdytg6/LXvPnzHNkARgNLGOV+dmBT0jC6npqZR18QM44N ibgFktmHJdTRunzsoDBMKAMCZ+kU6Bjaan9JdMTrRxqBwCyS+FIen//R3quCJYVVKU4+ q5dzLWDk5uxdxpPJ2cLYXTb8njumYZxG63GVA1mB75caO104YGSnB2Q1ptrxYptDeDW0 8SpBe1n1kzBpc3P+/u88vA7ElY/q5EFFcFaWrhKlNeJ2rW/6EWUNHz2uaT7tXFKP5Q4i lKXXiJDIvjZhSvTRMJZ8+0fn9rtGURlOXwXj1opTTaCSFJWeHMuqAVVbKz8g/M24ee2K EnOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=j3yYXVuNbU3rhESLy4t3wT/4T/s2fSR6sys/WNopir4=; b=hRct6ZGrde3VQrkjOTo3cF3dHbRW3jno/Mud5pIvt4hDjnSbaff2OLGHT3Bebymclj n9tXYWpBiv4PAbpUHGFGSegXDFdKCxhx+bGtaRa6MPBmfCmu/JW5WqA5NvH82o1g5ajt tCMgByUCaUVNaW3zHNKBJj0IW9xCGAloqISwRcJp1+K3uUMTEdx93JIwRgM4R/grk99D ydE43OT9mdQ7rL5aXvB9REq/WuhRgglp2FkpovxAMuU8knEELsHLhLGQd0nRpVLgdQKk 10z6wFkfR96e0qH0rB4+/3lHW++K/g3B6X/1R7uMd7ixkk6Y2r11A4U72uTKc1GveeBd GS2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=wyUIvYIo; dkim=pass header.i=@linaro.org header.s=google header.b=kFqs40Su; spf=pass (google.com: domain of libc-alpha-return-107897-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-107897-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id z23si2292083otk.166.2019.12.10.10.32.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Dec 2019 10:32:58 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-107897-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=wyUIvYIo; dkim=pass header.i=@linaro.org header.s=google header.b=kFqs40Su; spf=pass (google.com: domain of libc-alpha-return-107897-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-107897-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=hjPygp5l04YY/u2+bv835/Ln4iWu5Vs 0J4dYlWEjeWStbvjfa4Fd/Pn83DYuLgUm95GWqSXZGceXv8fK2T6vvX8OmKMbxSE lMcpi+iOR/WZoMwHdY/8p7sK2eshjASBUelzO/vXedFVtKqwzP/6QKgKoWlk26pk gKQlRBoMC4I4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=OXZDNyN+EuPNu9xOuaehhKvoRo0=; b=wyUIv YIof8TdfbfvS3TDFascqZulHVA7tF/rwgWkO6sO1h81TGkpZbLHjplfFEv+C103/ f1qn+3CY402HUnfZajC5dZskvjbcqOclBh0Fyt/JwuhHva/k6rFXkOqEz64rPv77 fdqZNXoObouZFmIbAu+O+/llGpX5quxKjQY11M= Received: (qmail 39318 invoked by alias); 10 Dec 2019 18:32:34 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 39259 invoked by uid 89); 10 Dec 2019 18:32:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=communicate X-HELO: mail-ua1-f53.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=j3yYXVuNbU3rhESLy4t3wT/4T/s2fSR6sys/WNopir4=; b=kFqs40Su22BU+4lm1TESbO3MFpjs9/WR6GwHpkaiOOOPPVV+87yQWEkiRNfVu3Y2Ca xoIkeIMuNjCuxw5EgsVauSszgevFKNhEdMSTUJqFhx4s6fed3O/lpPtTJOiEgx8igI3u Kdl46421VDfMY2eJJIIc4reFZJCYkc5/vuApQcX8kkoBruRzXpIcVSDitko/cDZjasK1 YE2k08TS4IDEtIlGBrBshN20mjE6g4DPB+DNm9F6Yu+eMCcVFySxnkPg6ody64NiHehV SEriIYoWZUNV1JNOlVETT4SC+NGgs20tNcVkVT4OXJTjfTuM+RuoO26d8b4xavGxSgAj QEzg== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 3/7] Fix return code for __libc_signal_* functions Date: Tue, 10 Dec 2019 15:32:17 -0300 Message-Id: <20191210183221.26912-3-adhemerval.zanella@linaro.org> In-Reply-To: <20191210183221.26912-1-adhemerval.zanella@linaro.org> References: <20191210183221.26912-1-adhemerval.zanella@linaro.org> since the function should not fail if input argument is NULL. Also, for Linux the return value is not fully correct on some platforms due the missing usage of INTERNAL_SYSCALL_ERROR_P / INTERNAL_SYSCALL_ERRNO macros. Checked on x86_64-linux-gnu, i686-linux-gnu, and sparc64-linux-gnu. --- sysdeps/generic/internal-signals.h | 12 ++++++------ sysdeps/unix/sysv/linux/internal-signals.h | 18 +++++++++--------- 2 files changed, 15 insertions(+), 15 deletions(-) -- 2.17.1 diff --git a/sysdeps/generic/internal-signals.h b/sysdeps/generic/internal-signals.h index a515e3e649..41c24dc4b3 100644 --- a/sysdeps/generic/internal-signals.h +++ b/sysdeps/generic/internal-signals.h @@ -34,28 +34,28 @@ __clear_internal_signals (sigset_t *set) { } -static inline int +static inline void __libc_signal_block_all (sigset_t *set) { sigset_t allset; __sigfillset (&allset); - return __sigprocmask (SIG_BLOCK, &allset, set); + __sigprocmask (SIG_BLOCK, &allset, set); } -static inline int +static inline void __libc_signal_block_app (sigset_t *set) { sigset_t allset; __sigfillset (&allset); __clear_internal_signals (&allset); - return __sigprocmask (SIG_BLOCK, &allset, set); + __sigprocmask (SIG_BLOCK, &allset, set); } /* Restore current process signal mask. */ -static inline int +static inline void __libc_signal_restore_set (const sigset_t *set) { - return __sigprocmask (SIG_SETMASK, set, NULL); + __sigprocmask (SIG_SETMASK, set, NULL); } diff --git a/sysdeps/unix/sysv/linux/internal-signals.h b/sysdeps/unix/sysv/linux/internal-signals.h index 4b70109c14..04e1ec4f0a 100644 --- a/sysdeps/unix/sysv/linux/internal-signals.h +++ b/sysdeps/unix/sysv/linux/internal-signals.h @@ -71,30 +71,30 @@ static const sigset_t sigapp_set = { }; /* Block all signals, including internal glibc ones. */ -static inline int +static inline void __libc_signal_block_all (sigset_t *set) { INTERNAL_SYSCALL_DECL (err); - return INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_BLOCK, &sigall_set, - set, _NSIG / 8); + INTERNAL_SYSCALL_CALL (rt_sigprocmask, err, SIG_BLOCK, &sigall_set, set, + _NSIG / 8); } /* Block all application signals (excluding internal glibc ones). */ -static inline int +static inline void __libc_signal_block_app (sigset_t *set) { INTERNAL_SYSCALL_DECL (err); - return INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_BLOCK, &sigapp_set, - set, _NSIG / 8); + INTERNAL_SYSCALL_CALL (rt_sigprocmask, err, SIG_BLOCK, &sigapp_set, set, + _NSIG / 8); } /* Restore current process signal mask. */ -static inline int +static inline void __libc_signal_restore_set (const sigset_t *set) { INTERNAL_SYSCALL_DECL (err); - return INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_SETMASK, set, NULL, - _NSIG / 8); + INTERNAL_SYSCALL_CALL (rt_sigprocmask, err, SIG_SETMASK, set, NULL, + _NSIG / 8); } /* Used to communicate with signal handler. */