diff options
Diffstat (limited to 'binutils/ar.c')
-rw-r--r-- | binutils/ar.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/binutils/ar.c b/binutils/ar.c index f37713e..4a504327 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 |