diff options
author | David E. O'Brien <obrien@FreeBSD.org> | 2000-06-20 06:20:42 +0000 |
---|---|---|
committer | David E. O'Brien <obrien@FreeBSD.org> | 2000-06-20 06:20:42 +0000 |
commit | 9cf1d3773b86cefa5afcb52cbfae9cb335bb7637 (patch) | |
tree | 3f2e79c5a66aac2f8eb0a069744251ab05fcc87d /contrib/binutils/bfd/cache.c | |
parent | 30565a54fcfe17393cf34d115abbdfb53c056c22 (diff) | |
download | src-9cf1d3773b86cefa5afcb52cbfae9cb335bb7637.tar.gz src-9cf1d3773b86cefa5afcb52cbfae9cb335bb7637.zip |
Import a virgin (but trimed) Binutils 2.10 release.
Notes
Notes:
svn path=/vendor/binutils/dist/; revision=61843
Diffstat (limited to 'contrib/binutils/bfd/cache.c')
-rw-r--r-- | contrib/binutils/bfd/cache.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/contrib/binutils/bfd/cache.c b/contrib/binutils/bfd/cache.c index ad3140e1ed73..91b6c610854b 100644 --- a/contrib/binutils/bfd/cache.c +++ b/contrib/binutils/bfd/cache.c @@ -1,5 +1,6 @@ /* BFD library -- caching of file descriptors. - Copyright 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. + Copyright 1990, 91, 92, 93, 94, 95, 1996, 2000 + Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support (steve@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -300,10 +301,17 @@ bfd_open_file (abfd) So we unlink the output file if and only if it has non-zero size. */ +#ifndef __MSDOS__ + /* Don't do this for MSDOS: it doesn't care about overwriting + a running binary, but if this file is already open by + another BFD, we will be in deep trouble if we delete an + open file. In fact, objdump does just that if invoked with + the --info option. */ struct stat s; if (stat (abfd->filename, &s) == 0 && s.st_size != 0) unlink (abfd->filename); +#endif abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_WB); abfd->opened_once = true; } |