From patchwork Fri Dec 27 14:56:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 182484 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp3066311ild; Fri, 27 Dec 2019 06:56:21 -0800 (PST) X-Google-Smtp-Source: APXvYqxT9nj0pIxJ9iEySQL0VwpdC4cjrR+tmon6kxHBUZ6PYYc4FKz2z8d6WHDVDIXoK8HwT/r6 X-Received: by 2002:a05:6830:1755:: with SMTP id 21mr56763244otz.323.1577458581445; Fri, 27 Dec 2019 06:56:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577458581; cv=none; d=google.com; s=arc-20160816; b=oCIRD0GfZgLcXLUe5UdymoLSItFuWgdnioCBaVlTDQjUMy459HhX2+0LlaezB3uPbE /vD9IxCK44hvKPqbwnkEV0reZGKVX7LopvjZksyyTs8dOg+/i40V6Gb/SH9oqcfZxpNC Hg/jCQTkMx8S/EbcxuzrzD7h6/va0unxDgAGTII8oCuXVfPlT+Eqw3pdBrbN/bHKQDCq PDmK7W9fPlhl1BKj8UHFxz572diD1Bi20TuQ6DeBAtArREwEYdxiLdQn3QCoh+tORq8V AmXb5cgGswdQmD1KFDBc3Ij4U4ITfF69Dm8vDsRHRXL3Cest36MgEJkhjZwGWY2/pLDk xymQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=6qTK+Dc5GvYolSNPoASbmGzzTVpRtTnBNyGb9BLucqY=; b=ZDPZhu1W9G2Bn/eIUvFtq4MzUpAxuKe23kC6doYLDKsnehAbPDVyKt4hq8Jya0uPqm dFPVoGlqDu6NyHQV3JgUCu41ugNxcHr68cao03w8D3Zp1BwJC2GnXxIw/S/U9oY6NyDu Cg6YwcDVcIPspCQ6JzJ7Q6Kwt5Z9HSc2jnXQFk60o22RC/dA4LQew/zQD1oaI0G00nam VIN/zxjlQy2N+abV7Q4BorYmQ7Vm9/U2eeY0Z2gthkheVXO/hZlXGkLxLCL2x84vb70m pxWn5MZKhzLweBUXwZBeoyNvL5nCm1sYAoxGQdKhvPRGQKKj1AEoaCXyNA8+OEvAV3eU /xMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=UYdM7cZ0; dkim=pass header.i=@linaro.org header.s=google header.b=yVoUhc4P; spf=pass (google.com: domain of libc-alpha-return-108332-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-108332-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 w18si11699450otj.148.2019.12.27.06.56.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Dec 2019 06:56:21 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-108332-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=UYdM7cZ0; dkim=pass header.i=@linaro.org header.s=google header.b=yVoUhc4P; spf=pass (google.com: domain of libc-alpha-return-108332-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-108332-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; q=dns; s= default; b=jjiWygPAgI6GzbqbMaYV2PeM67q/tqBKcUX9mLsEvvs513HO6ttux X8BDcpH2Pe0W4f3bvw1Wc1tbUbbsQkpEjmhNXx0QTyH/VYT1t06v2KF1qmeqUp8d YWZQ8583ZYePYTi5raLQ62NVt1OB6Gz1UOGnTA8+R/vqEonisiGVQM= 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; s=default; bh=sHyMKraBqq7ErOVsaNGgMtNtSk0=; b=UYdM7cZ0Icu5+izMmrYNAQ2qiMFF UFism3+wLufbUwv+r05sWuMf/jqMCo9S4GKy/M0iPqXb2xOsxCZ4FdU/Xi0GcB8S Qu/2xDCvWXyCyuup2RFvC43NZsXhcNkpE7pM4nhTHkwQtywQK/sZ53FPLS9fcX9w QhFjlKygRcw29D0= Received: (qmail 99127 invoked by alias); 27 Dec 2019 14:56:13 -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 99118 invoked by uid 89); 27 Dec 2019 14:56:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.0 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= X-HELO: mail-pl1-f180.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id; bh=6qTK+Dc5GvYolSNPoASbmGzzTVpRtTnBNyGb9BLucqY=; b=yVoUhc4PUL/lw+KUAhxlQsfnTy9qpopusCPfP0walei4egnuM72MGyToOFqP96H5jj 0LyBGcbfFuLxwM0k7U0LrXq/0XvX5OdWBhqolHWDb9D8jAZyozGWmro7CzKYnlyGpaHg cyzidnDqAoKL6D0PhFgI+Df9+bxjjpDhUehAidUd7skiHwowAZCxUak+PxJMBTDGteut ZjXqq4sdW4djqMbCLmhPN25dQ9kAYzEZ5ZyfW3CF9SPtY+C6/CFOCaglkoKdzl0ppQmY kw7pBrERrb92tLoVEv5lK1p9KOtbdbvZVDIJNpPLw/LyrW40R0sBapfDg/10r5/QhpRh 0ReQ== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [COMMITTED] Fix return code for __libc_signal_* functions Date: Fri, 27 Dec 2019 11:56:00 -0300 Message-Id: <20191227145601.12404-1-adhemerval.zanella@linaro.org> The functions do not fail regardless of the argument value. Also, for Linux the return value is not 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 a496c7174c..2932e21fd0 100644 --- a/sysdeps/unix/sysv/linux/internal-signals.h +++ b/sysdeps/unix/sysv/linux/internal-signals.h @@ -59,32 +59,32 @@ static const sigset_t sigall_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) { sigset_t allset = sigall_set; __clear_internal_signals (&allset); INTERNAL_SYSCALL_DECL (err); - return INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_BLOCK, &allset, - set, _NSIG / 8); + INTERNAL_SYSCALL_CALL (rt_sigprocmask, err, SIG_BLOCK, &allset, 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. */