summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehwan Kim <jae.hwan.kim@samsung.com>2015-06-17 17:37:01 +0900
committerJaehwan Kim <jae.hwan.kim@samsung.com>2015-06-17 17:38:24 +0900
commitb1c5de0b9aa67b9d5cc4722e9462830beb3af37b (patch)
tree35480fdd8d691fec342b27f7a1001578295cf024
parentcbf26a518607e7c41d2d1dc71e25db19dd500031 (diff)
config: make a config directory, if it is not.
create the config directory to register flush file to eio_monitor.
-rw-r--r--src/lib/elm_config.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index bf2ea325b..fe6ad274d 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -3338,9 +3338,22 @@ _elm_config_sub_init(void)
3338 } 3338 }
3339#endif 3339#endif
3340 char buf[PATH_MAX]; 3340 char buf[PATH_MAX];
3341 size_t len;
3342 int ok = 0;
3341 3343
3342 _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/flush", 3344 len = _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/");
3343 _elm_profile); 3345 if (len + 6 >= sizeof(buf)) // the space to add "/flush"
3346 goto end;
3347
3348 ok = ecore_file_mkpath(buf);
3349 if (!ok)
3350 {
3351 ERR("Problem accessing Elementary's user configuration directory: %s",
3352 buf);
3353 goto end;
3354 }
3355
3356 strcat(buf, "flush");
3344 if (!ecore_file_exists(buf)) 3357 if (!ecore_file_exists(buf))
3345 { 3358 {
3346 FILE *f = fopen(buf, "w+"); 3359 FILE *f = fopen(buf, "w+");
@@ -3349,11 +3362,13 @@ _elm_config_sub_init(void)
3349 { 3362 {
3350 fprintf(f, "flush"); 3363 fprintf(f, "flush");
3351 fclose(f); 3364 fclose(f);
3365 goto end;
3352 } 3366 }
3353 } 3367 }
3354 _eio_monitor = eio_monitor_add(buf); 3368 _eio_monitor = eio_monitor_add(buf);
3355 ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, _elm_config_file_monitor_cb, NULL); 3369 ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, _elm_config_file_monitor_cb, NULL);
3356 3370
3371end:
3357 _config_sub_apply(); 3372 _config_sub_apply();
3358} 3373}
3359 3374