cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=da5c0c63f212078c215219ca0e97c8dbc1c576de

commit da5c0c63f212078c215219ca0e97c8dbc1c576de
Author: Wonki Kim <wonki_....@samsung.com>
Date:   Mon Nov 4 01:43:34 2019 +0000

    elm_config: replace ecore_file_cp with ecore_file_mv
    
    ecore_file_cp can cause config data(eet file) invalid,
    once multiple processes are trying to call elm_config_save.
    
    this patch replaces it with ecore_file_mv to prevent the problem.
    
    Reviewed-by: Cedric BAIL <cedric.b...@free.fr>
    Differential Revision: https://phab.enlightenment.org/D10578
---
 src/lib/elementary/elm_config.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c
index 05a2b2b601..476eb15c4d 100644
--- a/src/lib/elementary/elm_config.c
+++ b/src/lib/elementary/elm_config.c
@@ -809,9 +809,11 @@ _elm_config_profile_derived_save(const char *profile, 
Elm_Config_Derived *derive
         eet_close(ef);
         if (ret)
           {
-             if (!ecore_file_cp(buf, buf2))
-               ERR("Error saving Elementary's derived configuration profile 
file");
-             ecore_file_unlink(buf);
+             if (!ecore_file_mv(buf, buf2))
+               {
+                  ERR("Error saving Elementary's derived configuration profile 
file");
+                  ecore_file_unlink(buf);
+               }
           }
         else
           {
@@ -2155,15 +2157,13 @@ _elm_config_profile_save(const char *profile)
         goto err;
      }
 
-   ret = ecore_file_cp(buf2, buf);
+   ret = ecore_file_mv(buf2, buf);
    if (!ret)
      {
         ERR("Error saving Elementary's configuration profile file");
         goto err;
      }
 
-   ecore_file_unlink(buf2);
-
    derived = _elm_config_derived_load(profile ? profile : _elm_profile);
    if (derived)
      {
@@ -2248,14 +2248,13 @@ _elm_config_save(Elm_Config *cfg, const char *profile)
         goto err;
      }
 
-   ret = ecore_file_cp(buf2, buf);
+   ret = ecore_file_mv(buf2, buf);
    if (!ret)
      {
         ERR("Error saving Elementary's configuration file");
         goto err;
      }
 
-   ecore_file_unlink(buf2);
    return EINA_TRUE;
 
 err:

-- 


Reply via email to