summaryrefslogtreecommitdiff
path: root/src/lib/efreet
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-08-25 11:24:54 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-08-25 11:24:54 +0100
commit2f534b0256c68327dae371d4400ffb643ffc9dfe (patch)
tree2df2ea197b0ca1c142c88448bf28ef70fce405ed /src/lib/efreet
parent9f9cfe65a664c2d6fdda33ccc2f49372e9a5bfb5 (diff)
efreet - make efreet launch timeout configurable by env var
also report as an ERR explicitly if its a timeout.
Diffstat (limited to 'src/lib/efreet')
-rw-r--r--src/lib/efreet/efreet_cache.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/lib/efreet/efreet_cache.c b/src/lib/efreet/efreet_cache.c
index 25ad39bf5a..2045d70c23 100644
--- a/src/lib/efreet/efreet_cache.c
+++ b/src/lib/efreet/efreet_cache.c
@@ -115,19 +115,36 @@ static void
115_ipc_launch(void) 115_ipc_launch(void)
116{ 116{
117 char buf[PATH_MAX]; 117 char buf[PATH_MAX];
118 int num = 0; 118 int num;
119 int try_gap = 10000; // 10ms
120 int tries = 200; // 200 * 10ms == 2sec
121 const char *s;
119 122
123 s = getenv("EFREETD_CONNECT_TRIES");
124 if (s)
125 {
126 num = atoi(s);
127 if (num >= 0) tries = num;
128 }
129 s = getenv("EFREETD_CONNECT_TRY_GAP");
130 if (s)
131 {
132 num = atoi(s);
133 if (num >= 0) try_gap = num;
134 }
120 if (run_in_tree) 135 if (run_in_tree)
121 bs_binary_get(buf, sizeof(buf), "efreet", "efreetd"); 136 bs_binary_get(buf, sizeof(buf), "efreet", "efreetd");
122 else 137 else
123 snprintf(buf, sizeof(buf), PACKAGE_BIN_DIR "/efreetd"); 138 snprintf(buf, sizeof(buf), PACKAGE_BIN_DIR "/efreetd");
124 ecore_exe_run(buf, NULL); 139 ecore_exe_run(buf, NULL);
125 while ((!ipc) && (num < 200)) 140 num = 0;
141 while ((!ipc) && (num < tries))
126 { 142 {
127 num++; 143 num++;
128 usleep(10000); 144 usleep(try_gap);
129 ipc = ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, "efreetd", 0, NULL); 145 ipc = ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, "efreetd", 0, NULL);
130 } 146 }
147 if (!ipc) ERR("Timeout in trying to start and then connect to efrteed");
131} 148}
132 149
133static Eina_Bool 150static Eina_Bool