aboutsummaryrefslogtreecommitdiff
path: root/gdb/inf-child.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-07-22 11:56:33 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-09-30 15:21:48 -0400
commit13084383e8955c2ff7017ac8839301688a9ee34d (patch)
treeffc4d5429e7315de53715fe7fce7bd26abd958b8 /gdb/inf-child.c
parente6e51c9c4b402cd46595790b26087ebf2fead8c1 (diff)
downloadfsf-binutils-gdb-13084383e8955c2ff7017ac8839301688a9ee34d.zip
fsf-binutils-gdb-13084383e8955c2ff7017ac8839301688a9ee34d.tar.gz
fsf-binutils-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 'gdb/inf-child.c')
-rw-r--r--gdb/inf-child.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/inf-child.c b/gdb/inf-child.c
index f690aa7..5084f44 100644
--- a/gdb/inf-child.c
+++ b/gdb/inf-child.c
@@ -261,7 +261,7 @@ inf_child_target::fileio_open (struct inferior *inf, const char *filename,
return -1;
}
- fd = gdb_open_cloexec (filename, nat_flags, nat_mode);
+ fd = gdb_open_cloexec (filename, nat_flags, nat_mode).release ();
if (fd == -1)
*target_errno = host_to_fileio_error (errno);