summaryrefslogtreecommitdiff
path: root/src/bin/ipc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/ipc.c')
-rw-r--r--src/bin/ipc.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/bin/ipc.c b/src/bin/ipc.c
index c9b9ee7..83b265c 100644
--- a/src/bin/ipc.c
+++ b/src/bin/ipc.c
@@ -1,6 +1,7 @@
1#include "private.h" 1#include "private.h"
2 2
3#include <Ecore.h> 3#include <Ecore.h>
4#include <Ecore_Con.h>
4#include <Ecore_Ipc.h> 5#include <Ecore_Ipc.h>
5#include <Eet.h> 6#include <Eet.h>
6#include "ipc.h" 7#include "ipc.h"
@@ -171,6 +172,19 @@ ipc_instance_new_func_set(void (*func) (Ipc_Instance *inst))
171 func_new_inst = func; 172 func_new_inst = func;
172} 173}
173 174
175void
176ipc_instance_conn_free(void)
177{
178 char *hash = _ipc_hash_get();
179 char *address = ecore_con_local_path_new(EINA_FALSE,
180 hash,
181 0);
182 errno = 0;
183 unlink(address);
184 ERR("unlinking: '%s': %s", address, strerror(errno));
185 free(address);
186}
187
174Eina_Bool 188Eina_Bool
175ipc_instance_add(Ipc_Instance *inst) 189ipc_instance_add(Ipc_Instance *inst)
176{ 190{
@@ -178,7 +192,7 @@ ipc_instance_add(Ipc_Instance *inst)
178 void *data; 192 void *data;
179 char *hash = _ipc_hash_get(); 193 char *hash = _ipc_hash_get();
180 Ecore_Ipc_Server *ipcsrv; 194 Ecore_Ipc_Server *ipcsrv;
181 195
182 if (!hash) return EINA_FALSE; 196 if (!hash) return EINA_FALSE;
183 data = eet_data_descriptor_encode(new_inst_edd, inst, &size); 197 data = eet_data_descriptor_encode(new_inst_edd, inst, &size);
184 if (!data) 198 if (!data)
@@ -186,6 +200,7 @@ ipc_instance_add(Ipc_Instance *inst)
186 free(hash); 200 free(hash);
187 return EINA_FALSE; 201 return EINA_FALSE;
188 } 202 }
203
189 ipcsrv = ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, hash, 0, NULL); 204 ipcsrv = ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, hash, 0, NULL);
190 if (ipcsrv) 205 if (ipcsrv)
191 { 206 {
@@ -196,6 +211,10 @@ ipc_instance_add(Ipc_Instance *inst)
196 ecore_ipc_server_del(ipcsrv); 211 ecore_ipc_server_del(ipcsrv);
197 return EINA_TRUE; 212 return EINA_TRUE;
198 } 213 }
214 else
215 {
216 DBG("connect failed");
217 }
199 free(data); 218 free(data);
200 free(hash); 219 free(hash);
201 return EINA_FALSE; 220 return EINA_FALSE;