Ecore_file: on Windows, fix errno value when dst exists.

Summary: This also fixes the saving of elementary_config file

Test Plan: execution of elementary_config

Reviewers: jptiz, raster

Reviewed By: raster

Subscribers: johnny1337, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12165
This commit is contained in:
Vincent Torri 2020-10-06 15:09:31 +01:00 committed by Carsten Haitzler (Rasterman)
parent 387a720091
commit 0a08a860a8
1 changed files with 6 additions and 6 deletions

View File

@ -514,11 +514,11 @@ ecore_file_mv(const char *src, const char *dst)
} }
} }
#ifdef _WIN32 #ifdef _WIN32
if (errno == EEXIST) if (errno == ENOENT)
{ {
struct _stat s; struct _stat s;
_stat(dst, &s); _stat(dst, &s);
if (_S_IFREG & s.st_mode) if (_S_IFREG & s.st_mode)
{ {
ecore_file_unlink(dst); ecore_file_unlink(dst);
if (rename(src, dst)) if (rename(src, dst))
@ -526,7 +526,7 @@ ecore_file_mv(const char *src, const char *dst)
return EINA_TRUE; return EINA_TRUE;
} }
} }
} }
#endif #endif
goto FAIL; goto FAIL;
} }