From: Steve Chamberlain Date: Tue, 29 Oct 1991 07:13:23 +0000 (+0000) Subject: Don't care about an unlink failure X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0885eef1294ce1593fc5a08dd6f21411d7f87bc7;p=binutils-gdb.git Don't care about an unlink failure --- diff --git a/binutils/ar.c b/binutils/ar.c index f37713e25fd..4a504327954 100644 --- a/binutils/ar.c +++ b/binutils/ar.c @@ -692,8 +692,11 @@ write_archive() if (!bfd_close(obfd)) bfd_fatal(inarch->filename); - if (unlink(inarch->filename) != 0) - bfd_fatal(inarch->filename); + + /* We don't care if this fails, we might be creating the + archive */ + (void) unlink(inarch->filename); + if (rename(new_name, inarch->filename) != 0) bfd_fatal(inarch->filename); #if 0