From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14822 invoked by alias); 29 Sep 2018 03:22:29 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 14800 invoked by uid 89); 29 Sep 2018 03:22:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 29 Sep 2018 03:22:26 +0000 Received: from [10.0.0.136] (modemcable044.137-81-70.mc.videotron.ca [70.81.137.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 729E61E186; Fri, 28 Sep 2018 23:22:25 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=simark.ca; s=mail; t=1538191345; bh=qkWWasklmKoUbT5bTkSpRd6X+BLtEb72Lbv5E8cH1PA=; h=Subject:To:References:From:Date:In-Reply-To:From; b=LSVYsGNJ9DP7lW6xdFuvuEyPpnMbN9iUzneoLhNtha6t/7YgkugWyYmKZLmpTOkKl I7rSqJ57F+2NOR+WDFuKwyh2oFWYKCQO/UIpFuSoqtZsoRTRrCSAxColhGNyrxclVG o9MECaZlLyLXbo5m7zT5ucHYYlOzU1Eq58rEXQAE= Subject: Re: [RFC 5/6] Do not reopen temporary files To: Tom Tromey , gdb-patches@sourceware.org References: <20180926111130.18956-1-tom@tromey.com> <20180926111130.18956-6-tom@tromey.com> From: Simon Marchi Message-ID: Date: Sat, 29 Sep 2018 03:22:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180926111130.18956-6-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-09/txt/msg00928.txt.bz2 On 2018-09-26 7:11 a.m., Tom Tromey wrote: > diff --git a/gdb/dwarf-index-write.c b/gdb/dwarf-index-write.c > index 7049e8968a..341e16bfc5 100644 > --- a/gdb/dwarf-index-write.c > +++ b/gdb/dwarf-index-write.c > @@ -1565,23 +1565,21 @@ write_psymtabs_to_index (struct dwarf2_per_objfile *dwarf2_per_objfile, > ? INDEX5_SUFFIX : INDEX4_SUFFIX)); > gdb::char_vector filename_temp = make_temp_filename (filename); > > - gdb::optional out_file_fd > - (gdb::in_place, gdb_mkstemp_cloexec (filename_temp.data ())); > - if (out_file_fd->get () == -1) > + /* Order matters here; we want FILE to be closed before FILENAME_TEMP is > + unlinked, because on MS-Windows one cannot delete a file that is > + still open. (Don't call anything here that might throw until > + file_closer is created.) So, we wrap the unlinker in an optional I just noticed this refers to file_closer, a variable that doesn't exist anymore (or has been renamed). Otherwise this LGTM. Simon