mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-12-19 01:19:41 +08:00
gdbsupport: make gdb_mkostemp_cloexec return a scoped_fd
This encourages the callers to use automatic file descriptor management. Change-Id: I137a81df6f3607b457e28c35aafde8ed6f3a3344
This commit is contained in:
@@ -1833,7 +1833,7 @@ copy_shell_to_cache (const char *shell, const std::string &new_name)
|
||||
new_dir.c_str (), safe_strerror (errno));
|
||||
|
||||
gdb::char_vector temp_name = make_temp_filename (new_name);
|
||||
scoped_fd to_fd (gdb_mkostemp_cloexec (&temp_name[0]));
|
||||
scoped_fd to_fd = gdb_mkostemp_cloexec (&temp_name[0]);
|
||||
gdb::unlinker unlink_file_on_error (temp_name.data ());
|
||||
|
||||
if (to_fd.get () < 0)
|
||||
|
||||
Reference in New Issue
Block a user