efreet: move update files

Move update files to separate subdir to reduce inotify triggers

SVN revision: 78176
This commit is contained in:
Sebastian Dransfeld 2012-10-18 09:40:00 +00:00
parent d1bf182ec8
commit a473306c0e
3 changed files with 24 additions and 2 deletions

View File

@ -272,6 +272,12 @@ main(int argc, char **argv)
if (!ecore_file_mkpath(file)) goto efreet_error;
efreet_setowner(file);
}
snprintf(file, sizeof(file), "%s/efreet/update", efreet_cache_home_get());
if (!ecore_file_exists(file))
{
if (!ecore_file_mkpath(file)) goto efreet_error;
efreet_setowner(file);
}
/* lock process, so that we only run one copy of this program */
lockfd = cache_lock_file();
@ -491,7 +497,7 @@ main(int argc, char **argv)
}
/* touch update file */
snprintf(file, sizeof(file), "%s/efreet/desktop_data.update", efreet_cache_home_get());
snprintf(file, sizeof(file), "%s/efreet/update/desktop_data.update", efreet_cache_home_get());
tmpfd = open(file, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR);
if (tmpfd >= 0)
{

View File

@ -852,6 +852,12 @@ main(int argc, char **argv)
if (!ecore_file_mkpath(file)) return -1;
efreet_setowner(file);
}
snprintf(file, sizeof(file), "%s/efreet/update", efreet_cache_home_get());
if (!ecore_file_exists(file))
{
if (!ecore_file_mkpath(file)) return -1;
efreet_setowner(file);
}
/* lock process, so that we only run one copy of this program */
lockfd = cache_lock_file();
@ -1112,7 +1118,7 @@ main(int argc, char **argv)
free(theme_version);
/* touch update file */
snprintf(file, sizeof(file), "%s/efreet/icon_data.update", efreet_cache_home_get());
snprintf(file, sizeof(file), "%s/efreet/update/icon_data.update", efreet_cache_home_get());
tmpfd = open(file, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR);
if (tmpfd >= 0)
{

View File

@ -142,6 +142,16 @@ efreet_cache_init(void)
}
efreet_setowner(buf);
}
snprintf(buf, sizeof(buf), "%s/efreet/update", efreet_cache_home_get());
if (!ecore_file_exists(buf))
{
if (!ecore_file_mkpath(buf))
{
ERR("Failed to create directory '%s'", buf);
goto error;
}
efreet_setowner(buf);
}
cache_exe_handler = ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
cache_exe_cb, NULL);