This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC 5/6] Do not reopen temporary files
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<scoped_fd> 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