diff options
author | dannysmith <dannysmith@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-30 09:58:48 +0000 |
---|---|---|
committer | dannysmith <dannysmith@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-30 09:58:48 +0000 |
commit | e39224c2bae86dea7402c483c4838668481f4aed (patch) | |
tree | bce791a3c35ae1160381c46c5016b45ddd7e3328 /gcc/tlink.c | |
parent | d0c5a09035460d72a74f96d59d77009afbb81b7d (diff) | |
download | gcc-e39224c2bae86dea7402c483c4838668481f4aed.tar.gz |
Merge from csl-arm-branch.
2004-02-12 Mark Mitchell <mark@codesourcery.com>
* tlink.c (recompile_files): Do not assume that "rename" can
overwrite an existing file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97252 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tlink.c')
-rw-r--r-- | gcc/tlink.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/tlink.c b/gcc/tlink.c index bf4e1d757b0..3fe531af9e7 100644 --- a/gcc/tlink.c +++ b/gcc/tlink.c @@ -470,7 +470,13 @@ recompile_files (void) } fclose (stream); fclose (output); - rename (outname, f->key); + /* On Windows "rename" returns -1 and sets ERRNO to EACCESS if + the new file name already exists. Therefore, we explicitly + remove the old file first. */ + if (remove (f->key) == -1) + fatal_perror ("removing .rpo file"); + if (rename (outname, f->key) == -1) + fatal_perror ("renaming .rpo file"); if (!f->args) { |