summaryrefslogtreecommitdiff
path: root/src/bin/e_ipc.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2014-03-20 13:29:02 -0400
committerMike Blumenkrantz <zmike@samsung.com>2014-03-20 14:06:41 -0400
commit2bbab7e525ef0f94bef3b160808195eb8a363e42 (patch)
treecda72ec2825ffb7bad5ac7f51fc65ba67a4df140 /src/bin/e_ipc.c
parent07841a6b5e0521622813aa5dfe7f8305cc89e9e7 (diff)
export e_ipc_socket filename as extern variable
Diffstat (limited to 'src/bin/e_ipc.c')
-rw-r--r--src/bin/e_ipc.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/bin/e_ipc.c b/src/bin/e_ipc.c
index 9face3d..5af2f69 100644
--- a/src/bin/e_ipc.c
+++ b/src/bin/e_ipc.c
@@ -1,5 +1,7 @@
1#include "e.h" 1#include "e.h"
2 2
3EINTERN char *e_ipc_socket = NULL;
4
3#ifdef USE_IPC 5#ifdef USE_IPC
4/* local subsystem functions */ 6/* local subsystem functions */
5static Eina_Bool _e_ipc_cb_client_add(void *data __UNUSED__, int type __UNUSED__, void *event); 7static Eina_Bool _e_ipc_cb_client_add(void *data __UNUSED__, int type __UNUSED__, void *event);
@@ -14,7 +16,6 @@ static Ecore_Ipc_Server *_e_ipc_server = NULL;
14EINTERN int 16EINTERN int
15e_ipc_init(void) 17e_ipc_init(void)
16{ 18{
17#ifdef USE_IPC
18 char buf[4096], buf2[128], buf3[4096]; 19 char buf[4096], buf2[128], buf3[4096];
19 char *tmp, *user, *disp, *base; 20 char *tmp, *user, *disp, *base;
20 int pid, trynum = 0, id1 = 0; 21 int pid, trynum = 0, id1 = 0;
@@ -88,15 +89,22 @@ e_ipc_init(void)
88 ((st.st_mode & (S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO)) == 89 ((st.st_mode & (S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO)) ==
89 (S_IRWXU | S_IFDIR))) 90 (S_IRWXU | S_IFDIR)))
90 { 91 {
92#ifdef USE_IPC
91 snprintf(buf3, sizeof(buf3), "%s/%s-%i", 93 snprintf(buf3, sizeof(buf3), "%s/%s-%i",
92 buf, disp, pid); 94 buf, disp, pid);
93 _e_ipc_server = ecore_ipc_server_add 95 _e_ipc_server = ecore_ipc_server_add
94 (ECORE_IPC_LOCAL_SYSTEM, buf3, 0, NULL); 96 (ECORE_IPC_LOCAL_SYSTEM, buf3, 0, NULL);
95 if (_e_ipc_server) break; 97 if (_e_ipc_server)
98#endif
99 {
100 e_ipc_socket = strdup(ecore_file_file_get(buf));
101 break;
102 }
96 } 103 }
97retry: 104retry:
98 id1 = rand(); 105 id1 = rand();
99 } 106 }
107#ifdef USE_IPC
100 if (!_e_ipc_server) 108 if (!_e_ipc_server)
101 { 109 {
102 ERR("Gave up after 4096 sockets in '%s'. All failed", base); 110 ERR("Gave up after 4096 sockets in '%s'. All failed", base);
@@ -128,6 +136,7 @@ e_ipc_shutdown(void)
128 _e_ipc_server = NULL; 136 _e_ipc_server = NULL;
129 } 137 }
130#endif 138#endif
139 E_FREE(e_ipc_socket);
131 return 1; 140 return 1;
132} 141}
133 142