summaryrefslogtreecommitdiff
path: root/src/bin/efreet
diff options
context:
space:
mode:
authorSebastian Dransfeld <sebastian.dransfeld@sintef.no>2013-06-20 13:53:54 +0200
committerSebastian Dransfeld <sebastian.dransfeld@sintef.no>2013-06-20 13:53:54 +0200
commit58fc3a8f32d6fe71910ee0479afc3c8478c12540 (patch)
tree4b3c1578d871f0ce4bfcfe08d0c254c5b8f05af5 /src/bin/efreet
parent336f6ec32814a119a4b7f7ea8063c1d56da5e387 (diff)
efreet: Low priority for cache rebuild
Diffstat (limited to 'src/bin/efreet')
-rw-r--r--src/bin/efreet/efreet_desktop_cache_create.c3
-rw-r--r--src/bin/efreet/efreet_icon_cache_create.c3
-rw-r--r--src/bin/efreet/efreetd.c4
-rw-r--r--src/bin/efreet/efreetd_cache.c9
4 files changed, 10 insertions, 9 deletions
diff --git a/src/bin/efreet/efreet_desktop_cache_create.c b/src/bin/efreet/efreet_desktop_cache_create.c
index db3118ca1d..17f41e342a 100644
--- a/src/bin/efreet/efreet_desktop_cache_create.c
+++ b/src/bin/efreet/efreet_desktop_cache_create.c
@@ -5,6 +5,8 @@
5#include <fcntl.h> 5#include <fcntl.h>
6#include <unistd.h> 6#include <unistd.h>
7#include <errno.h> 7#include <errno.h>
8#include <sys/time.h>
9#include <sys/resource.h>
8 10
9#include <Eina.h> 11#include <Eina.h>
10#include <Eet.h> 12#include <Eet.h>
@@ -250,6 +252,7 @@ main(int argc, char **argv)
250 } 252 }
251 extra_dirs = eina_list_sort(extra_dirs, -1, EINA_COMPARE_CB(strcmp)); 253 extra_dirs = eina_list_sort(extra_dirs, -1, EINA_COMPARE_CB(strcmp));
252 254
255 setpriority(PRIO_PROCESS, 0, 19);
253 /* init external subsystems */ 256 /* init external subsystems */
254 if (!eet_init()) goto eet_error; 257 if (!eet_init()) goto eet_error;
255 if (!ecore_init()) goto ecore_error; 258 if (!ecore_init()) goto ecore_error;
diff --git a/src/bin/efreet/efreet_icon_cache_create.c b/src/bin/efreet/efreet_icon_cache_create.c
index a4f774ca8f..74732807b0 100644
--- a/src/bin/efreet/efreet_icon_cache_create.c
+++ b/src/bin/efreet/efreet_icon_cache_create.c
@@ -6,6 +6,8 @@
6#include <fcntl.h> 6#include <fcntl.h>
7#include <unistd.h> 7#include <unistd.h>
8#include <errno.h> 8#include <errno.h>
9#include <sys/time.h>
10#include <sys/resource.h>
9 11
10#include <Eina.h> 12#include <Eina.h>
11#include <Eet.h> 13#include <Eet.h>
@@ -768,6 +770,7 @@ main(int argc, char **argv)
768 flush = EINA_TRUE; 770 flush = EINA_TRUE;
769 } 771 }
770 772
773 setpriority(PRIO_PROCESS, 0, 19);
771 if (!eet_init()) return -1; 774 if (!eet_init()) return -1;
772 if (!ecore_init()) return -1; 775 if (!ecore_init()) return -1;
773 776
diff --git a/src/bin/efreet/efreetd.c b/src/bin/efreet/efreetd.c
index 97b516299c..d3f6d8cfac 100644
--- a/src/bin/efreet/efreetd.c
+++ b/src/bin/efreet/efreetd.c
@@ -2,6 +2,9 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include <sys/time.h>
6#include <sys/resource.h>
7
5#include <Ecore.h> 8#include <Ecore.h>
6#include <Ecore_File.h> 9#include <Ecore_File.h>
7 10
@@ -34,6 +37,7 @@ main(int argc, char *argv[])
34 if (!dbus_init()) goto dbus_error; 37 if (!dbus_init()) goto dbus_error;
35 if (!cache_init()) goto cache_error; 38 if (!cache_init()) goto cache_error;
36 39
40 setpriority(PRIO_PROCESS, 0, 19);
37 ecore_main_loop_begin(); 41 ecore_main_loop_begin();
38 42
39 cache_shutdown(); 43 cache_shutdown();
diff --git a/src/bin/efreet/efreetd_cache.c b/src/bin/efreet/efreetd_cache.c
index 4d7fd9d2d6..c286b13db0 100644
--- a/src/bin/efreet/efreetd_cache.c
+++ b/src/bin/efreet/efreetd_cache.c
@@ -42,7 +42,6 @@ static Eina_Bool
42icon_cache_update_cache_cb(void *data EINA_UNUSED) 42icon_cache_update_cache_cb(void *data EINA_UNUSED)
43{ 43{
44 char file[PATH_MAX]; 44 char file[PATH_MAX];
45 int prio;
46 45
47 icon_cache_timer = NULL; 46 icon_cache_timer = NULL;
48 47
@@ -55,9 +54,6 @@ icon_cache_update_cache_cb(void *data EINA_UNUSED)
55 if ((!icon_flush) && (!icon_exts)) return ECORE_CALLBACK_CANCEL; 54 if ((!icon_flush) && (!icon_exts)) return ECORE_CALLBACK_CANCEL;
56 55
57 /* TODO: Queue if already running */ 56 /* TODO: Queue if already running */
58 prio = ecore_exe_run_priority_get();
59 ecore_exe_run_priority_set(19);
60
61 snprintf(file, sizeof(file), 57 snprintf(file, sizeof(file),
62 "%s/efreet/" MODULE_ARCH "/efreet_icon_cache_create", 58 "%s/efreet/" MODULE_ARCH "/efreet_icon_cache_create",
63 eina_prefix_lib_get(pfx)); 59 eina_prefix_lib_get(pfx));
@@ -90,7 +86,6 @@ icon_cache_update_cache_cb(void *data EINA_UNUSED)
90 icon_flush = EINA_FALSE; 86 icon_flush = EINA_FALSE;
91 icon_cache_exe = 87 icon_cache_exe =
92 ecore_exe_pipe_run(file, ECORE_EXE_PIPE_READ|ECORE_EXE_PIPE_READ_LINE_BUFFERED, NULL); 88 ecore_exe_pipe_run(file, ECORE_EXE_PIPE_READ|ECORE_EXE_PIPE_READ_LINE_BUFFERED, NULL);
93 ecore_exe_run_priority_set(prio);
94 89
95 return ECORE_CALLBACK_CANCEL; 90 return ECORE_CALLBACK_CANCEL;
96} 91}
@@ -109,7 +104,6 @@ static Eina_Bool
109desktop_cache_update_cache_cb(void *data EINA_UNUSED) 104desktop_cache_update_cache_cb(void *data EINA_UNUSED)
110{ 105{
111 char file[PATH_MAX]; 106 char file[PATH_MAX];
112 int prio;
113 107
114 desktop_cache_timer = NULL; 108 desktop_cache_timer = NULL;
115 109
@@ -119,8 +113,6 @@ desktop_cache_update_cache_cb(void *data EINA_UNUSED)
119 return ECORE_CALLBACK_CANCEL; 113 return ECORE_CALLBACK_CANCEL;
120 } 114 }
121 desktop_queue = EINA_FALSE; 115 desktop_queue = EINA_FALSE;
122 prio = ecore_exe_run_priority_get();
123 ecore_exe_run_priority_set(19);
124 116
125 snprintf(file, sizeof(file), 117 snprintf(file, sizeof(file),
126 "%s/efreet/" MODULE_ARCH "/efreet_desktop_cache_create", 118 "%s/efreet/" MODULE_ARCH "/efreet_desktop_cache_create",
@@ -140,7 +132,6 @@ desktop_cache_update_cache_cb(void *data EINA_UNUSED)
140 INF("Run desktop cache creation: %s", file); 132 INF("Run desktop cache creation: %s", file);
141 desktop_cache_exe = 133 desktop_cache_exe =
142 ecore_exe_pipe_run(file, ECORE_EXE_PIPE_READ|ECORE_EXE_PIPE_READ_LINE_BUFFERED, NULL); 134 ecore_exe_pipe_run(file, ECORE_EXE_PIPE_READ|ECORE_EXE_PIPE_READ_LINE_BUFFERED, NULL);
143 ecore_exe_run_priority_set(prio);
144 135
145 return ECORE_CALLBACK_CANCEL; 136 return ECORE_CALLBACK_CANCEL;
146} 137}