From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88755 invoked by alias); 2 Nov 2018 09:51:04 -0000 Mailing-List: contact libc-stable-help@sourceware.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: List-Archive: Sender: libc-stable-owner@sourceware.org Received: (qmail 88668 invoked by uid 89); 2 Nov 2018 09:51:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-Spam-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Nov 2018 09:51:02 +0000 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1592381DEA for ; Fri, 2 Nov 2018 09:51:01 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-117-198.ams2.redhat.com [10.36.117.198]) by smtp.corp.redhat.com (Postfix) with ESMTP id D1FCE194AA for ; Fri, 2 Nov 2018 09:51:00 +0000 (UTC) Received: by oldenburg.str.redhat.com (Postfix, from userid 1000) id D2AEA4399457D; Fri, 2 Nov 2018 10:50:57 +0100 (CET) Date: Mon, 01 Jan 2018 00:00:00 -0000 To: libc-stable@sourceware.org Subject: [2.28 COMMITTED] support_blob_repeat: Call mkstemp directory for the backing file User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20181102095057.D2AEA4399457D@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 02 Nov 2018 09:51:01 +0000 (UTC) X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg00003.txt.bz2 This avoids a warning during post-test cleanup. (cherry picked from commit a91e9301c47bb688f4e496a19cfc68261ff18293) 2018-10-30 Florian Weimer * support/blob_repeat.c (allocate_big): Call mkstemp directly. diff --git a/support/blob_repeat.c b/support/blob_repeat.c index da4ca83043..16c1e448b9 100644 --- a/support/blob_repeat.c +++ b/support/blob_repeat.c @@ -23,8 +23,8 @@ #include #include #include +#include #include -#include #include #include #include @@ -155,13 +155,17 @@ allocate_big (size_t total_size, const void *element, size_t element_size, if (target == MAP_FAILED) return (struct support_blob_repeat) { 0 }; - /* Create the backing file for the repeated mapping. */ + /* Create the backing file for the repeated mapping. Call mkstemp + directly to remove the resources backing the temporary file + immediately, once support_blob_repeat_free is called. Using + create_temp_file would result in a warning during post-test + cleanup. */ int fd; { - char *temppath; - fd = create_temp_file ("support_blob_repeat-", &temppath); + char *temppath = xasprintf ("%s/support_blob_repeat-XXXXXX", test_dir); + fd = mkstemp (temppath); if (fd < 0) - FAIL_EXIT1 ("create_temp_file: %m"); + FAIL_EXIT1 ("mkstemp (\"%s\"): %m", temppath); xunlink (temppath); free (temppath); }