From 1bea231f28700bdbb29ff72c13ca7991759305ad Mon Sep 17 00:00:00 2001 From: Wonki Kim Date: Mon, 21 Oct 2019 20:10:02 +0900 Subject: [PATCH] elm_config: replace ecore_file_cp with ecore_file_mv ecore_file_cp can cause elm_config eet data invalid. this patch replaces it with ecore_file_mv to prevent the problem. Change-Id: I5e39ab88cf5ecb70e9d9823b43ebdcc92b2cfc51 Signed-off-by: Wonki Kim --- 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 ac7b86b..4f0eb68 100644 --- a/src/lib/elementary/elm_config.c +++ b/src/lib/elementary/elm_config.c @@ -907,9 +907,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 { @@ -2405,15 +2407,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) { @@ -2524,14 +2524,13 @@ _elm_config_save_internal(Elm_Config *cfg, const char *profile, Elm_Config_Snpri 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: -- 2.7.4