them before unlinking them and removing the temporary directory,
to avoid NFS problems.
PR 6795.
Tue Jul 4 14:48:42 1995 Ian Lance Taylor <ian@cygnus.com>
+ * objcopy.c (copy_archive): Record all output BFD's, and close
+ them before unlinking them and removing the temporary directory,
+ to avoid NFS problems.
+
* ar.c (replace_members): In verbose messages, use 'r' when
replacing a member, and 'a' when adding one.
{
struct name_list *next;
char *name;
+ bfd *obfd;
} *list, *l;
bfd **ptr = &obfd->archive_head;
bfd *this_element;
/* Open the newly output file and attach to our list. */
output_bfd = bfd_openr (output_name, output_target);
+ l->obfd = output_bfd;
+
*ptr = output_bfd;
ptr = &output_bfd->next;
nonfatal (bfd_get_filename (obfd));
}
- /* Delete all the files that we opened. */
- for (l = list; l != NULL; l = l->next)
- unlink (l->name);
- rmdir (dir);
-
if (!bfd_close (ibfd))
{
nonfatal (bfd_get_filename (ibfd));
}
+
+ /* Delete all the files that we opened. */
+ for (l = list; l != NULL; l = l->next)
+ {
+ bfd_close (l->obfd);
+ unlink (l->name);
+ }
+ rmdir (dir);
}
/* The top-level control. */