Commit 8e0b1746 authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

makedep: Handle non-overwriting rename for Windows.

parent 7823679e
...@@ -960,7 +960,14 @@ static void output_dependencies(void) ...@@ -960,7 +960,14 @@ static void output_dependencies(void)
if (tmp_name) if (tmp_name)
{ {
if (rename( tmp_name, OutputFileName ) == -1) int ret = rename( tmp_name, OutputFileName );
if (ret == -1 && errno == EEXIST)
{
/* rename doesn't overwrite on windows */
unlink( OutputFileName );
ret = rename( tmp_name, OutputFileName );
}
if (ret == -1)
{ {
unlink( tmp_name ); unlink( tmp_name );
fatal_error( "failed to rename output file to '%s'\n", OutputFileName ); fatal_error( "failed to rename output file to '%s'\n", OutputFileName );
......
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