From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dormouse.ash.relay.mailchannels.net (dormouse.ash.relay.mailchannels.net [23.83.222.50]) by sourceware.org (Postfix) with ESMTPS id 2CB2D3858D33 for ; Tue, 6 Jun 2023 12:21:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2CB2D3858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 93B156417D4; Tue, 6 Jun 2023 12:21:03 +0000 (UTC) Received: from pdx1-sub0-mail-a232.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 2952F64133E; Tue, 6 Jun 2023 12:20:53 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1686054063; a=rsa-sha256; cv=none; b=ctLd5wRdVwQNAPEfZoe5n1aKlYwI1RPyhPGl07zYlUk76UIWDTXcttTj/yVXLdI+ci0iAu 65NVdAn7HKVFtceg7G5Nslw1XO5ulTsPm4qMTPtzfCV+OFnvM4VAH1h3etOgM8E4C0tbum cYqD4pCNcuAlXvCE0JrH+b35mjwVygjQZWU09JO81fjcyHIK8KBdZAyhPeIOE5BQ4cMzLk vLU6aF5KsrpxkW9guXlYt10bB4Jvcs/OUl5/4gJ8qehx0M6AZXcQCHnEhH+UXqPTX8SZX6 Z6kikh8FuuBljWklLSP6Bse9+XfUYZZz/WOKDvETtDhilALqWYIGk/RJA1ezuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1686054063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Yo4XfR+x8HuJBEGKfgSfxIs+F3ALvBNdUqdD0ljEduc=; b=eBcmdlPSczFNioB4cYx/mqfH8hZ4q2XFIFX9y9AvlwhXSs/Wu1pK9mNgQ9w/s9nNZcsqQQ WzQqKiVRk4mDVnsrW7z+mOeCTV9BKq6rFIpt3XgXRa2tZ6kMdjMJblRNQZebu7v73ebi6V 3WKPHXbRGRmeKpUyOaoUfe1ag/bgm53eFdpWv+tc35NR+2y6Cf52Z9V+WzIY34w3QaT4k8 cYyPRoZEWGqMszn58UXPNlrTdXx76Pkx0Pk41C/kmpt2Nn4ObM4Tm9sKb+2L+MQkKLlbkc lDAVmlsWmlgPWrnOB0h+tziPy/hltuHPSIhOjYDv4onJB1frs478Vaa6wvD96w== ARC-Authentication-Results: i=1; rspamd-56648fb6f9-9qfj4; auth=pass smtp.auth=dreamhost smtp.mailfrom=siddhesh@gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Ruddy-Well-Made: 03aa60d53887d420_1686054063401_1439857176 X-MC-Loop-Signature: 1686054063401:3544253852 X-MC-Ingress-Time: 1686054063401 Received: from pdx1-sub0-mail-a232.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.119.120.24 (trex/6.8.1); Tue, 06 Jun 2023 12:21:03 +0000 Received: from [192.168.0.182] (bras-vprn-toroon4834w-lp130-02-142-113-138-85.dsl.bell.ca [142.113.138.85]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a232.dreamhost.com (Postfix) with ESMTPSA id 4Qb8hN5DPpzb9; Tue, 6 Jun 2023 05:20:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gotplt.org; s=dreamhost; t=1686054052; bh=Yo4XfR+x8HuJBEGKfgSfxIs+F3ALvBNdUqdD0ljEduc=; h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding; b=ruZhTU958yC6FB9/gk2fb6j02UCoQNcbLBiS7KAbJxMnIn3mFsodQRlD8/14otS3x a9U0/m/3mdS8bOYeFBaWM+mB0lb6ZkRWm/VLyTt1OE5i5GWXqcP2ixnpUgfCc6c2tt HAmtTHK9va1dK3jYbtNWku9PCsH4vbS3EexMgHkCgKennWfm0/nGu7fuVq7yIeBuHj H6MkUrhK79nJPMNoGq0tT59rpHNEFziGB531+0ZBPjKJMSFiOsu7fueHx1+kj9LJdW 4a/+bbSkHTGGwq0aAgidtd/AGqausEc3g6HZcMSKh+/7iH2mdgM4FqKXGHZTLrGY4G KaY7QHQqzD6aA== Message-ID: <4c21a126-4188-58f2-77b1-225a0a4ca6be@gotplt.org> Date: Tue, 6 Jun 2023 08:20:51 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v6 6/7] tests: Replace various function calls with their x variant Content-Language: en-US To: =?UTF-8?B?RnLDqWTDqXJpYyBCw6lyYXQ=?= , libc-alpha@sourceware.org References: <20230602152812.108497-1-fberat@redhat.com> <20230602152812.108497-7-fberat@redhat.com> From: Siddhesh Poyarekar In-Reply-To: <20230602152812.108497-7-fberat@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3037.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2023-06-02 11:28, Frédéric Bérat wrote: > With fortification enabled, few function calls return result need to be > checked, has they get the __wur macro enabled. > --- > Changes since v5: > - Actually replace functions with their x variant as described LGTM. Reviewed-by: Siddhesh Poyarekar > > misc/tst-error1.c | 4 +++- > nss/tst-reload2.c | 2 +- > posix/tst-chmod.c | 7 +++++-- > posix/wordexp-test.c | 2 +- > stdlib/test-canon.c | 4 +++- > 5 files changed, 13 insertions(+), 6 deletions(-) > > diff --git a/misc/tst-error1.c b/misc/tst-error1.c > index 9c4a62fbd0..75d4edf476 100644 > --- a/misc/tst-error1.c > +++ b/misc/tst-error1.c > @@ -5,11 +5,13 @@ > #include > #include > > +#include > + > static int > do_test (int argc, char *argv[]) > { > mtrace (); > - (void) freopen (argc == 1 ? "/dev/stdout" : argv[1], "a", stderr); > + xfreopen (argc == 1 ? "/dev/stdout" : argv[1], "a", stderr); > /* Orient the stream. */ > fwprintf (stderr, L"hello world\n"); > char buf[20000]; > diff --git a/nss/tst-reload2.c b/nss/tst-reload2.c > index ba9b5b7687..89cc9ea242 100644 > --- a/nss/tst-reload2.c > +++ b/nss/tst-reload2.c > @@ -121,7 +121,7 @@ do_test (void) > /* Change the root dir. */ > > TEST_VERIFY (chroot ("/subdir") == 0); > - chdir ("/"); > + xchdir ("/"); > > /* Check we're NOT using the "inner" nsswitch.conf. */ > > diff --git a/posix/tst-chmod.c b/posix/tst-chmod.c > index b98a05a265..470a696fe5 100644 > --- a/posix/tst-chmod.c > +++ b/posix/tst-chmod.c > @@ -27,6 +27,8 @@ > #include > #include > > +#include > + > > #define OUT_OF_MEMORY \ > do { \ > @@ -229,7 +231,8 @@ do_test (int argc, char *argv[]) > close (fd); > > snprintf (buf, buflen, "%s/..", testdir); > - chdir (buf); > + xchdir (buf); > + > /* We are now in the directory above the one we create the test > directory in. */ > > @@ -349,7 +352,7 @@ do_test (int argc, char *argv[]) > } > > fail: > - chdir (startdir); > + xchdir (startdir); > > /* Remove all the files. */ > chmod (testdir, 0700); > diff --git a/posix/wordexp-test.c b/posix/wordexp-test.c > index 524597d96b..28d1d1509b 100644 > --- a/posix/wordexp-test.c > +++ b/posix/wordexp-test.c > @@ -336,7 +336,7 @@ do_test (int argc, char *argv[]) > if (cwd == NULL) > cwd = ".."; > > - chdir (cwd); > + xchdir (cwd); > rmdir (tmpdir); > > return 0; > diff --git a/stdlib/test-canon.c b/stdlib/test-canon.c > index bf19b1f1b1..2874258722 100644 > --- a/stdlib/test-canon.c > +++ b/stdlib/test-canon.c > @@ -27,6 +27,8 @@ > #include > #include > > +#include > + > /* Prototype for our test function. */ > extern int do_test (int argc, char *argv[]); > #include > @@ -159,7 +161,7 @@ do_test (int argc, char ** argv) > } > > for (i = 0; i < (int) (sizeof (symlinks) / sizeof (symlinks[0])); ++i) > - symlink (symlinks[i].value, symlinks[i].name); > + xsymlink (symlinks[i].value, symlinks[i].name); > > int has_dir = mkdir ("doesExist", 0777) == 0; >