summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWonki Kim <wonki_.kim@samsung.com>2019-11-04 01:43:34 +0000
committerCedric BAIL <cedric.bail@free.fr>2019-11-06 03:01:57 -0800
commitda5c0c63f212078c215219ca0e97c8dbc1c576de (patch)
treeedf261ca642b1a28c1a2d3f6266e933a71a157f8 /src
parent249ffd6a50aeaa29480b40b19b5122354974fbda (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/elm_config.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c
index 05a2b2b..476eb15 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
809 eet_close(ef); 809 eet_close(ef);
810 if (ret) 810 if (ret)
811 { 811 {
812 if (!ecore_file_cp(buf, buf2)) 812 if (!ecore_file_mv(buf, buf2))
813 ERR("Error saving Elementary's derived configuration profile file"); 813 {
814 ecore_file_unlink(buf); 814 ERR("Error saving Elementary's derived configuration profile file");
815 ecore_file_unlink(buf);
816 }
815 } 817 }
816 else 818 else
817 { 819 {
@@ -2155,15 +2157,13 @@ _elm_config_profile_save(const char *profile)
2155 goto err; 2157 goto err;
2156 } 2158 }
2157 2159
2158 ret = ecore_file_cp(buf2, buf); 2160 ret = ecore_file_mv(buf2, buf);
2159 if (!ret) 2161 if (!ret)
2160 { 2162 {
2161 ERR("Error saving Elementary's configuration profile file"); 2163 ERR("Error saving Elementary's configuration profile file");
2162 goto err; 2164 goto err;
2163 } 2165 }
2164 2166
2165 ecore_file_unlink(buf2);
2166
2167 derived = _elm_config_derived_load(profile ? profile : _elm_profile); 2167 derived = _elm_config_derived_load(profile ? profile : _elm_profile);
2168 if (derived) 2168 if (derived)
2169 { 2169 {
@@ -2248,14 +2248,13 @@ _elm_config_save(Elm_Config *cfg, const char *profile)
2248 goto err; 2248 goto err;
2249 } 2249 }
2250 2250
2251 ret = ecore_file_cp(buf2, buf); 2251 ret = ecore_file_mv(buf2, buf);
2252 if (!ret) 2252 if (!ret)
2253 { 2253 {
2254 ERR("Error saving Elementary's configuration file"); 2254 ERR("Error saving Elementary's configuration file");
2255 goto err; 2255 goto err;
2256 } 2256 }
2257 2257
2258 ecore_file_unlink(buf2);
2259 return EINA_TRUE; 2258 return EINA_TRUE;
2260 2259
2261err: 2260err: