From patchwork Wed Jul 29 12:55:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 1338320 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=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=d1nNDWM7; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BGtnj2pFpz9sSy for ; Wed, 29 Jul 2020 22:55:52 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id B10763C2637 for ; Wed, 29 Jul 2020 14:55:47 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [IPv6:2001:4b78:1:20::3]) by picard.linux.it (Postfix) with ESMTP id 8B4903C1CB2 for ; Wed, 29 Jul 2020 14:55:44 +0200 (CEST) Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-3.smtp.seeweb.it (Postfix) with ESMTPS id 9F0681A01170 for ; Wed, 29 Jul 2020 14:55:43 +0200 (CEST) Received: by mail-pl1-x642.google.com with SMTP id k4so11746771pld.12 for ; Wed, 29 Jul 2020 05:55:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fpT/teL+RpZc3aK9SOL0O1T9ju2fFXUj4P53wCNi9ZQ=; b=d1nNDWM7hrjxnbymk3jFsWjx7kqKXLiIkK4PoFFn/u8i0zSm1p9eYZcVjHVJea6waG ULdTpJwjt/lYNfACtWRVWjb0pyP0NNsIsCPXHrPI2VuOIQ8XhuYsSwjsBcsfEZmlZAaS YLF9H9k5HJnbcK3aArsfrj0fC53WYaLGAXqT2gKj76lkVjDoBtt8EWdBrdoJ9dKbt+E3 Ytquf6ZmNfn0HKuYwffqGT6s3oib5lS6caW14ZK3iycs6xCBZjt4hUIOnP2+rmj+EqfF 5zPfprN1q7HC34tPPoB0KNKKw4+9AbA7P54gabscDCZutsZ2YIyvJvdVOH0Cz/Qf/EXV p1Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fpT/teL+RpZc3aK9SOL0O1T9ju2fFXUj4P53wCNi9ZQ=; b=ErB9TIqQ/QtcJV0Wes1Jiw4w504knD3WIkFJyQaiKkOKk4XOgonh91jLBVrnEPf0n5 09EvwRUN6mzbfZtnZZFiSCJPwiAKaf4t812ghBFNaa6vMvD4749hl6r61wKorEAmMBUS kh4Qqax7/GpZADd+TYhVkiAaCg7UPxf8WchMr0jvKloeQWdvscFnVlBjgr+13Wlfz+Cz sIONrPJBnSZb6bpT32P5bgVJepKeWeV0JzA7JgHViqPhOrmxdYRSe0wcK34N96XP0Fc5 SdBJdat5XSHJ7itRSkw56YYxILMIUFzg/3OZjVBfV6bzatSYOzFXi3l3gb544ITk82Cu rFiQ== X-Gm-Message-State: AOAM5306RoEIOg7qWgfhrKyn6i9cT1TwDw+3l83d1hrLKc/6MI7E1Gfc h7aESJk+zRN0wWNWhfSyDPllYhhQXEQ= X-Google-Smtp-Source: ABdhPJz30CoaXzI71ntZSWD6S1IL4XsJx+yyadqISaSJrwW1FjMcm9kQGeWrpCMo2qgJZ8vI67lKoQ== X-Received: by 2002:a17:902:8349:: with SMTP id z9mr28347898pln.46.1596027341778; Wed, 29 Jul 2020 05:55:41 -0700 (PDT) Received: from localhost ([182.68.37.99]) by smtp.gmail.com with ESMTPSA id d128sm2315950pfa.24.2020.07.29.05.55.40 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Jul 2020 05:55:40 -0700 (PDT) From: Viresh Kumar To: ltp@lists.linux.it Date: Wed, 29 Jul 2020 18:25:36 +0530 Message-Id: <82754cb787a5af12d61fb71364d40909d5503204.1596027282.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <53c9ed8dc17ea6fa0b46502cd1c724a3a8539c8c.1595842740.git.viresh.kumar@linaro.org> References: <53c9ed8dc17ea6fa0b46502cd1c724a3a8539c8c.1595842740.git.viresh.kumar@linaro.org> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH V3 1/2] libs: sigwait: Fix compilation warning around sigprocmask() X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Viresh Kumar , Vincent Guittot Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Newer gcc generates following warnings currently: sigwait.c: In function ‘test_masked_matching’: sigwait.c:157:42: warning: passing argument 3 to restrict-qualified parameter aliases with argument 2 [-Wrestrict] 157 | TEST(sigprocmask(SIG_SETMASK, &oldmask, &oldmask)); Fix these by replacing the third argument with sigs or removing it if not required. Also improve a comment while at it. Reported-by: Petr Vorel Signed-off-by: Viresh Kumar --- V3: - Fix function arguments. - Fix print message. libs/libltpsigwait/sigwait.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libs/libltpsigwait/sigwait.c b/libs/libltpsigwait/sigwait.c index dbd33a61f2b1..fd32efd8aa9f 100644 --- a/libs/libltpsigwait/sigwait.c +++ b/libs/libltpsigwait/sigwait.c @@ -156,11 +156,11 @@ void test_masked_matching(swi_func sigwaitinfo, int signo, && si.si_code == SI_USER && si.si_signo == signo, "Struct siginfo mismatch"); - TEST(sigprocmask(SIG_SETMASK, &oldmask, &oldmask)); + TEST(sigprocmask(SIG_SETMASK, &oldmask, &sigs)); if (TST_RET == -1) tst_brk(TBROK | TTERRNO, "restoring original signal mask failed"); - if (sigismember(&oldmask, signo)) + if (sigismember(&sigs, signo)) tst_res(TPASS, "sigwaitinfo restored the original mask"); else tst_res(TFAIL, @@ -214,11 +214,11 @@ void test_masked_matching_rt(swi_func sigwaitinfo, int signo, && si.si_signo == signo + 1, "Struct siginfo mismatch"); - TEST(sigprocmask(SIG_SETMASK, &oldmask, &oldmask)); + TEST(sigprocmask(SIG_SETMASK, &oldmask, &sigs)); if (TST_RET == -1) tst_brk(TBROK | TTERRNO, "restoring original signal mask failed"); - if (sigismember(&oldmask, signo)) + if (sigismember(&sigs, signo)) tst_res(TPASS, "sigwaitinfo restored the original mask"); else tst_res(TFAIL, @@ -250,11 +250,11 @@ void test_masked_matching_noinfo(swi_func sigwaitinfo, int signo, TEST(sigwaitinfo(&sigs, NULL, NULL)); REPORT_SUCCESS(signo, 0); - TEST(sigprocmask(SIG_SETMASK, &oldmask, &oldmask)); + TEST(sigprocmask(SIG_SETMASK, &oldmask, &sigs)); if (TST_RET == -1) tst_brk(TBROK | TTERRNO, "restoring original signal mask failed"); - if (sigismember(&oldmask, signo)) + if (sigismember(&sigs, signo)) tst_res(TPASS, "sigwaitinfo restored the original mask"); else tst_res(TFAIL, @@ -289,9 +289,9 @@ void test_bad_address(swi_func sigwaitinfo, int signo, TEST(sigwaitinfo(&sigs, (void *)1, NULL)); REPORT_SUCCESS(-1, EFAULT); - TEST(sigprocmask(SIG_SETMASK, &oldmask, &oldmask)); + TEST(sigprocmask(SIG_SETMASK, &oldmask, NULL)); if (TST_RET == -1) - tst_brk(TBROK | TTERRNO, "sigprocmask() failed"); + tst_brk(TBROK | TTERRNO, "restoring original signal mask failed"); SAFE_KILL(child, SIGTERM); SAFE_WAIT(NULL);