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 Netto X-Patchwork-Id: 1207201 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-107897-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="Zz+5+cD5"; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="kFqs40Su"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47XTFh1jF7z9sPh for ; Wed, 11 Dec 2019 05:32:55 +1100 (AEDT) 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=inZpmV2GC27ZuSWeAszxcCnex7AKZPX v/GW5bpMTaXzB8rOkgM1A7gaUgZnL/kk6A2wS+jwUod6WSoMcITYJQ7bAv6lZLkT fVSZFElXZK9XRUr/iTFi10MEOdjLRjGZpuutjN4B5miEVoMZb0RKqRG14p0maz7D JDOrlJNniOWo= 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=Zz+5+ cD5gPT8eNIbfGvksXFYHfhp4F0cu0dFxmNrADFEq1WAfd9mZV3OGMi092h0q5fXE 4GJn5DY0IkNwBwNf+JJnsvOxp5C+B/5N72kterSJGKNRHnuSARTBhFd4osWajM3H TT9oVXtAFf3fr88HJ/1khDIe0TicGIgSSFowhI= 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== 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(-) 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. */