forked from Imagelibrary/binutils-gdb
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
This commit is contained in:
@@ -541,7 +541,7 @@ gdb_bfd_open (const char *name, const char *target, int fd,
|
||||
|
||||
if (fd == -1)
|
||||
{
|
||||
fd = gdb_open_cloexec (name, O_RDONLY | O_BINARY, 0);
|
||||
fd = gdb_open_cloexec (name, O_RDONLY | O_BINARY, 0).release ();
|
||||
if (fd == -1)
|
||||
{
|
||||
bfd_set_error (bfd_error_system_call);
|
||||
|
||||
Reference in New Issue
Block a user