From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 1AF333857341 for ; Fri, 28 Apr 2023 12:35:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1AF333857341 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682685337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TF7S/xOt66PQ1MlirXA3lXPBNPbrD+GAX6jfAQnI2RM=; b=Bj4Rr0cPe6ZlpcHW7zhGydNlUp1CSLaWnjvBs3ZdA5yJcI9u7XRrfCpqNK7BaiowSDxOMk wTkY4EWJpeWMaj+13dHJ80fzzLilFqRakAS1cP+WeVXOKe0Aa871bXrPYeLjvNwyZkJox5 gbQitWSbKBgjju9a92ooDOIMwZJFCKc= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-84-sJmDmDyOOrqqxBYUz5FLuw-1; Fri, 28 Apr 2023 08:35:32 -0400 X-MC-Unique: sJmDmDyOOrqqxBYUz5FLuw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1CBB2280A330; Fri, 28 Apr 2023 12:35:32 +0000 (UTC) Received: from Nymeria-redhat.redhat.com (unknown [10.39.193.84]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6DF01C15BA0; Fri, 28 Apr 2023 12:35:31 +0000 (UTC) From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20B=C3=A9rat?= To: libc-alpha@sourceware.org Cc: siddhesh@gotplt.org, fberat@redhat.com Subject: [PATCH v4 12/15] tests: replace ftruncate by xftruncate Date: Fri, 28 Apr 2023 14:21:39 +0200 Message-Id: <20230428122142.928135-13-fberat@redhat.com> In-Reply-To: <20230418121130.844302-2-fberat@redhat.com> References: <20230428122142.928135-1-fberat@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: With fortification enabled, ftruncate calls return result needs to be checked, has it gets the __wur macro enabled. --- io/tst-copy_file_range.c | 2 +- posix/tst-getopt-cancel.c | 3 ++- stdio-common/tst-perror.c | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/io/tst-copy_file_range.c b/io/tst-copy_file_range.c index d1f3aaa5a9..bd64e9c42b 100644 --- a/io/tst-copy_file_range.c +++ b/io/tst-copy_file_range.c @@ -166,7 +166,7 @@ short_copy (void) inoff = 3; xlseek (infd, shift, SEEK_SET); } - ftruncate (outfd, 0); + xftruncate (outfd, 0); xlseek (outfd, 0, SEEK_SET); outoff = 0; diff --git a/posix/tst-getopt-cancel.c b/posix/tst-getopt-cancel.c index 7167d1a914..6f49391690 100644 --- a/posix/tst-getopt-cancel.c +++ b/posix/tst-getopt-cancel.c @@ -33,6 +33,7 @@ #include #include #include +#include static bool check_stderr (bool expect_errmsg, FILE *stderr_trapped) @@ -48,7 +49,7 @@ check_stderr (bool expect_errmsg, FILE *stderr_trapped) fputs (lineptr, stdout); } rewind (stderr_trapped); - ftruncate (fileno (stderr_trapped), 0); + xftruncate (fileno (stderr_trapped), 0); return got_errmsg == expect_errmsg; } diff --git a/stdio-common/tst-perror.c b/stdio-common/tst-perror.c index 57835e0c59..b4ab583462 100644 --- a/stdio-common/tst-perror.c +++ b/stdio-common/tst-perror.c @@ -9,6 +9,7 @@ #include #include +#include #define MB_EXP \ "null mode test 1: Invalid or incomplete multibyte or wide character\n" \ @@ -94,7 +95,7 @@ do_test (void) puts ("multibyte test succeeded"); lseek (fd, 0, SEEK_SET); - ftruncate (fd, 0); + xftruncate (fd, 0); if (dup2 (fd, 2) == -1) { -- 2.39.2