diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-07-22 11:56:33 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-09-30 15:21:48 -0400 |
commit | 13084383e8955c2ff7017ac8839301688a9ee34d (patch) | |
tree | ffc4d5429e7315de53715fe7fce7bd26abd958b8 /gdbsupport/scoped_mmap.cc | |
parent | e6e51c9c4b402cd46595790b26087ebf2fead8c1 (diff) | |
download | gdb-13084383e8955c2ff7017ac8839301688a9ee34d.zip gdb-13084383e8955c2ff7017ac8839301688a9ee34d.tar.gz gdb-13084383e8955c2ff7017ac8839301688a9ee34d.tar.bz2 |
gdbsupport: make gdb_open_cloexec return scoped_fd
Make gdb_open_cloexec return a scoped_fd, to encourage using automatic
management of the file descriptor closing. Except in the most trivial
cases, I changed the callers to just release the fd, which retains their
existing behavior. That will allow the transition to using scoped_fd
more to go gradually, one caller at a time.
Change-Id: Ife022b403f96e71d5ebb4f1056ef6251b30fe554
Diffstat (limited to 'gdbsupport/scoped_mmap.cc')
-rw-r--r-- | gdbsupport/scoped_mmap.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdbsupport/scoped_mmap.cc b/gdbsupport/scoped_mmap.cc index c76fb77..598b328 100644 --- a/gdbsupport/scoped_mmap.cc +++ b/gdbsupport/scoped_mmap.cc @@ -27,7 +27,7 @@ scoped_mmap mmap_file (const char *filename) { - scoped_fd fd (gdb_open_cloexec (filename, O_RDONLY, 0)); + scoped_fd fd = gdb_open_cloexec (filename, O_RDONLY, 0); if (fd.get () < 0) perror_with_name (("open")); |