makedep: Handle non-overwriting rename for Windows.
This commit is contained in:
parent
7823679e20
commit
8e0b17462b
|
@ -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 );
|
||||||
|
|
Loading…
Reference in New Issue