forked from Imagelibrary/binutils-gdb
PR binutils/2876
* configure.in: Check for the mkstemp and mkdtemp functions. * configure: Regenerate. * config.in (HAVE_MKDTEMP): New potential define. (MAKE_MKSTEMP): Likewise. * bucomm.c (make_tempname): Use mkstemp if it is available. * make_tempdir): New function: Create a temporary directory using mkdtemp, if it is available. * bucomm.h (make_tempdir): New prototype. * objcopy.c (copy_archive): Use make_tempdir if it is available. (strip_main): Produce an warning message if a temporary file could not be (copy_main): Likewise. * ar.c (write_archive): Likewise.
This commit is contained in:
@@ -922,6 +922,9 @@ write_archive (bfd *iarch)
|
||||
strcpy (old_name, bfd_get_filename (iarch));
|
||||
new_name = make_tempname (old_name);
|
||||
|
||||
if (new_name == NULL)
|
||||
bfd_fatal ("could not create temporary file whilst writing archive");
|
||||
|
||||
output_filename = new_name;
|
||||
|
||||
obfd = bfd_openw (new_name, bfd_get_target (iarch));
|
||||
|
||||
Reference in New Issue
Block a user