diff options
author | Tom Tromey <tom@tromey.com> | 2018-09-20 16:30:47 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-10-27 11:58:41 -0600 |
commit | 36033ef57cd048588f9a3d5523712147066421f2 (patch) | |
tree | c5e9a94e4f5eb6b7c4bd50fe3baf53cd52eee73f /gdb/ChangeLog | |
parent | b3279b601e67ce47263082ef86cfc86e25607c5e (diff) | |
download | gdb-36033ef57cd048588f9a3d5523712147066421f2.zip gdb-36033ef57cd048588f9a3d5523712147066421f2.tar.gz gdb-36033ef57cd048588f9a3d5523712147066421f2.tar.bz2 |
Do not reopen temporary files
The current callers of mkostemp close the file descriptor and then
re-open it with fopen. It seemed better to me to continue to use the
already-opened file descriptor, so this patch rearranges the code a
little in order to do so. It takes care to ensure that the files are
only unlinked after the file descriptor in question is closed, as
before.
gdb/ChangeLog
2018-10-27 Tom Tromey <tom@tromey.com>
* unittests/scoped_fd-selftests.c (test_to_file): New function.
(run_tests): Call test_to_file.
* dwarf-index-write.c (write_psymtabs_to_index): Do not reopen
temporary files.
* common/scoped_fd.h (scoped_fd::to_file): New method.
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r-- | gdb/ChangeLog | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c6a5635..346d9c6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,13 @@ 2018-10-27 Tom Tromey <tom@tromey.com> + * unittests/scoped_fd-selftests.c (test_to_file): New function. + (run_tests): Call test_to_file. + * dwarf-index-write.c (write_psymtabs_to_index): Do not reopen + temporary files. + * common/scoped_fd.h (scoped_fd::to_file): New method. + +2018-10-27 Tom Tromey <tom@tromey.com> + * unittests/scoped_mmap-selftests.c (test_normal): Use gdb_mkostemp_cloexec. * unittests/scoped_fd-selftests.c (test_destroy, test_release): |