efreet: move update files
authorSebastian Dransfeld <sd@tango.flipp.net>
Thu, 18 Oct 2012 09:40:00 +0000 (09:40 +0000)
committerSebastian Dransfeld <sd@tango.flipp.net>
Thu, 18 Oct 2012 09:40:00 +0000 (09:40 +0000)
Move update files to separate subdir to reduce inotify triggers

SVN revision: 78176

legacy/efreet/src/bin/efreet_desktop_cache_create.c
legacy/efreet/src/bin/efreet_icon_cache_create.c
legacy/efreet/src/lib/efreet_cache.c

index af60a84..3b77f82 100644 (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)
     {
index 1ed629f..e24364b 100644 (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)
     {
index 437e184..ebf0857 100644 (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);