cache.c (60484) | cache.c (61843) |
---|---|
1/* BFD library -- caching of file descriptors. | 1/* BFD library -- caching of file descriptors. |
2 Copyright 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. | 2 Copyright 1990, 91, 92, 93, 94, 95, 1996, 2000 3 Free Software Foundation, Inc. |
3 Hacked by Steve Chamberlain of Cygnus Support (steve@cygnus.com). 4 5This file is part of BFD, the Binary File Descriptor library. 6 7This program is free software; you can redistribute it and/or modify 8it under the terms of the GNU General Public License as published by 9the Free Software Foundation; either version 2 of the License, or 10(at your option) any later version. --- 284 unchanged lines hidden (view full) --- 295 substituting other .o files during the compilation. gcc 296 will then tell the assembler to use the newly created 297 file as an output file. If we unlink the file here, we 298 open a brief window when another user could still 299 substitute a file. 300 301 So we unlink the output file if and only if it has 302 non-zero size. */ | 4 Hacked by Steve Chamberlain of Cygnus Support (steve@cygnus.com). 5 6This file is part of BFD, the Binary File Descriptor library. 7 8This program is free software; you can redistribute it and/or modify 9it under the terms of the GNU General Public License as published by 10the Free Software Foundation; either version 2 of the License, or 11(at your option) any later version. --- 284 unchanged lines hidden (view full) --- 296 substituting other .o files during the compilation. gcc 297 will then tell the assembler to use the newly created 298 file as an output file. If we unlink the file here, we 299 open a brief window when another user could still 300 substitute a file. 301 302 So we unlink the output file if and only if it has 303 non-zero size. */ |
304#ifndef __MSDOS__ 305 /* Don't do this for MSDOS: it doesn't care about overwriting 306 a running binary, but if this file is already open by 307 another BFD, we will be in deep trouble if we delete an 308 open file. In fact, objdump does just that if invoked with 309 the --info option. */ |
|
303 struct stat s; 304 305 if (stat (abfd->filename, &s) == 0 && s.st_size != 0) 306 unlink (abfd->filename); | 310 struct stat s; 311 312 if (stat (abfd->filename, &s) == 0 && s.st_size != 0) 313 unlink (abfd->filename); |
314#endif |
|
307 abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_WB); 308 abfd->opened_once = true; 309 } 310 break; 311 } 312 313 if (abfd->iostream != NULL) 314 { --- 51 unchanged lines hidden --- | 315 abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_WB); 316 abfd->opened_once = true; 317 } 318 break; 319 } 320 321 if (abfd->iostream != NULL) 322 { --- 51 unchanged lines hidden --- |