gdbsupport: make gdb_open_cloexec return scoped_fd
authorSimon Marchi <simon.marchi@polymtl.ca>
Thu, 22 Jul 2021 15:56:33 +0000 (11:56 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Thu, 30 Sep 2021 19:21:48 +0000 (15:21 -0400)
commit13084383e8955c2ff7017ac8839301688a9ee34d
treeffc4d5429e7315de53715fe7fce7bd26abd958b8
parente6e51c9c4b402cd46595790b26087ebf2fead8c1
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
16 files changed:
gdb/auxv.c
gdb/corelow.c
gdb/darwin-nat.c
gdb/gdb_bfd.c
gdb/inf-child.c
gdb/linux-nat.c
gdb/nat/linux-namespaces.c
gdb/remote-fileio.c
gdb/ser-unix.c
gdb/solib.c
gdb/source.c
gdb/top.c
gdb/tracefile-tfile.c
gdbsupport/filestuff.cc
gdbsupport/filestuff.h
gdbsupport/scoped_mmap.cc