From d8c9ee311128e7a7f394a44bc8fb3513d3a12057 Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Tue, 6 Oct 2020 15:09:31 +0100 Subject: [PATCH] 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 --- src/lib/ecore_file/ecore_file.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/ecore_file/ecore_file.c b/src/lib/ecore_file/ecore_file.c index 2e43336..bc9e4c5 100644 --- a/src/lib/ecore_file/ecore_file.c +++ b/src/lib/ecore_file/ecore_file.c @@ -532,11 +532,11 @@ ecore_file_mv(const char *src, const char *dst) } } #ifdef _WIN32 - if (errno == EEXIST) - { - struct _stat s; - _stat(dst, &s); - if (_S_IFREG & s.st_mode) + if (errno == ENOENT) + { + struct _stat s; + _stat(dst, &s); + if (_S_IFREG & s.st_mode) { ecore_file_unlink(dst); if (rename(src, dst)) @@ -544,7 +544,7 @@ ecore_file_mv(const char *src, const char *dst) return EINA_TRUE; } } - } + } #endif goto FAIL; } -- 2.7.4