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:
Simon Marchi 2021-07-22 15:33:42 -04:00
parent 13084383e8
commit 2fed9db40b
5 changed files with 13 additions and 12 deletions

View file

@ -1538,8 +1538,8 @@ struct index_wip_file
filename_temp = make_temp_filename (filename);
scoped_fd out_file_fd (gdb_mkostemp_cloexec (filename_temp.data (),
O_BINARY));
scoped_fd out_file_fd = gdb_mkostemp_cloexec (filename_temp.data (),
O_BINARY);
if (out_file_fd.get () == -1)
perror_with_name (("mkstemp"));