Commit 2d8a7f23 by Danny Smith Committed by Danny Smith

backport: tlink.c (recompile_files): Do not assume that "rename" can overwrite an existing file.

	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.

From-SVN: r97252
parent 9ecbc8f4
2005-03-31 Danny Smith <dannysmith@users.sourceforge.net>
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.
2005-03-31 Paolo Bonzini <bonzini@gnu.org> 2005-03-31 Paolo Bonzini <bonzini@gnu.org>
* gcc/configure.ac (TL_AC_GNU_MAKE_GCC_LIB_PATH): Remove. * gcc/configure.ac (TL_AC_GNU_MAKE_GCC_LIB_PATH): Remove.
......
...@@ -470,7 +470,13 @@ recompile_files (void) ...@@ -470,7 +470,13 @@ recompile_files (void)
} }
fclose (stream); fclose (stream);
fclose (output); 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) if (!f->args)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment