diff options
author | Alan Modra <amodra@gmail.com> | 2023-02-22 11:52:46 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-02-22 12:04:07 +1030 |
commit | 5e39600a691e3ba76acf6ab94edb24844c2e82b7 (patch) | |
tree | c625644e4fddca341d2b751c98142ebb1376bbbc /binutils | |
parent | 40f3e48ea254f481f7b469fd0f72f65fc80c5d08 (diff) | |
download | gdb-5e39600a691e3ba76acf6ab94edb24844c2e82b7.zip gdb-5e39600a691e3ba76acf6ab94edb24844c2e82b7.tar.gz gdb-5e39600a691e3ba76acf6ab94edb24844c2e82b7.tar.bz2 |
set bfd_error on make_tempname or make_tempdir failure
* bucomm.c (make_tempname, make_tempdir): Set bfd_error on error.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/bucomm.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/binutils/bucomm.c b/binutils/bucomm.c index df60ce0..c268fd3 100644 --- a/binutils/bucomm.c +++ b/binutils/bucomm.c @@ -555,6 +555,7 @@ make_tempname (const char *filename, int *ofd) if (fd == -1) { free (tmpname); + bfd_set_error (bfd_error_system_call); return NULL; } *ofd = fd; @@ -583,7 +584,10 @@ make_tempdir (const char *filename) #endif #endif if (ret == NULL) - free (tmpname); + { + free (tmpname); + bfd_set_error (bfd_error_system_call); + } return ret; } |