static bfd *obfd;
static char *real_name;
static char *temp_name;
-static int real_ofd;
+static int temp_fd;
static FILE *outfile;
static void
want to hack multiple references. */
for (ptr = list; ptr; ptr = ptr->next)
{
- bfd_boolean found = FALSE;
+ bool found = false;
bfd *prev = arch;
for (head = arch->archive_next; head; head = head->archive_next)
if (bfd_get_filename (head) != NULL
&& FILENAME_CMP (ptr->name, bfd_get_filename (head)) == 0)
{
- found = TRUE;
+ found = true;
function (head, prev);
}
prev = head;
static void
ar_directory_doer (bfd *abfd, bfd *ignore ATTRIBUTE_UNUSED)
{
- print_arelt_descr(outfile, abfd, verbose, FALSE);
+ print_arelt_descr(outfile, abfd, verbose, false);
}
void
ar_open (char *name, int t)
{
real_name = xstrdup (name);
- temp_name = make_tempname (real_name, &real_ofd);
+ temp_name = make_tempname (real_name, &temp_fd);
if (temp_name == NULL)
{
return;
}
- obfd = bfd_fdopenw (temp_name, NULL, real_ofd);
+ obfd = bfd_fdopenw (temp_name, NULL, temp_fd);
if (!obfd)
{
bfd *element;
bfd *ibfd;
+#if BFD_SUPPORTS_PLUGINS
+ ibfd = bfd_openr (name, "plugin");
+#else
ibfd = bfd_openr (name, NULL);
+#endif
if (!ibfd)
{
if (deterministic > 0)
obfd->flags |= BFD_DETERMINISTIC_OUTPUT;
+ temp_fd = dup (temp_fd);
bfd_close (obfd);
if (stat (real_name, &target_stat) != 0)
}
}
- smart_rename (temp_name, real_name, NULL);
+ smart_rename (temp_name, real_name, temp_fd, NULL, false);
obfd = 0;
free (temp_name);
free (real_name);