diff options
author | Wonki Kim <wonki_.kim@samsung.com> | 2019-11-04 01:43:34 +0000 |
---|---|---|
committer | Mike Blumenkrantz <zmike@samsung.com> | 2019-11-27 09:42:53 -0500 |
commit | 95f5c0b38f5365455168ce9aab4375a7243b65d8 (patch) | |
tree | 528cc5b7b8c18f3b1946c27dd841e23fd26a490f | |
parent | 7b315e857ce944e54454ac7999729e481210e24a (diff) | |
download | efl-95f5c0b38f5365455168ce9aab4375a7243b65d8.tar.gz |
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.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10578
-rw-r--r-- | src/lib/elementary/elm_config.c | 15 |
1 files 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: |