forked from enlightenment/enlightenment
export e_ipc_socket filename as extern variable
This commit is contained in:
parent
07841a6b5e
commit
2bbab7e525
|
@ -1,5 +1,7 @@
|
||||||
#include "e.h"
|
#include "e.h"
|
||||||
|
|
||||||
|
EINTERN char *e_ipc_socket = NULL;
|
||||||
|
|
||||||
#ifdef USE_IPC
|
#ifdef USE_IPC
|
||||||
/* local subsystem functions */
|
/* local subsystem functions */
|
||||||
static Eina_Bool _e_ipc_cb_client_add(void *data __UNUSED__, int type __UNUSED__, void *event);
|
static 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;
|
||||||
EINTERN int
|
EINTERN int
|
||||||
e_ipc_init(void)
|
e_ipc_init(void)
|
||||||
{
|
{
|
||||||
#ifdef USE_IPC
|
|
||||||
char buf[4096], buf2[128], buf3[4096];
|
char buf[4096], buf2[128], buf3[4096];
|
||||||
char *tmp, *user, *disp, *base;
|
char *tmp, *user, *disp, *base;
|
||||||
int pid, trynum = 0, id1 = 0;
|
int pid, trynum = 0, id1 = 0;
|
||||||
|
@ -88,15 +89,22 @@ e_ipc_init(void)
|
||||||
((st.st_mode & (S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO)) ==
|
((st.st_mode & (S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO)) ==
|
||||||
(S_IRWXU | S_IFDIR)))
|
(S_IRWXU | S_IFDIR)))
|
||||||
{
|
{
|
||||||
|
#ifdef USE_IPC
|
||||||
snprintf(buf3, sizeof(buf3), "%s/%s-%i",
|
snprintf(buf3, sizeof(buf3), "%s/%s-%i",
|
||||||
buf, disp, pid);
|
buf, disp, pid);
|
||||||
_e_ipc_server = ecore_ipc_server_add
|
_e_ipc_server = ecore_ipc_server_add
|
||||||
(ECORE_IPC_LOCAL_SYSTEM, buf3, 0, NULL);
|
(ECORE_IPC_LOCAL_SYSTEM, buf3, 0, NULL);
|
||||||
if (_e_ipc_server) break;
|
if (_e_ipc_server)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
e_ipc_socket = strdup(ecore_file_file_get(buf));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
retry:
|
retry:
|
||||||
id1 = rand();
|
id1 = rand();
|
||||||
}
|
}
|
||||||
|
#ifdef USE_IPC
|
||||||
if (!_e_ipc_server)
|
if (!_e_ipc_server)
|
||||||
{
|
{
|
||||||
ERR("Gave up after 4096 sockets in '%s'. All failed", base);
|
ERR("Gave up after 4096 sockets in '%s'. All failed", base);
|
||||||
|
@ -128,6 +136,7 @@ e_ipc_shutdown(void)
|
||||||
_e_ipc_server = NULL;
|
_e_ipc_server = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
E_FREE(e_ipc_socket);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#ifdef E_TYPEDEFS
|
#ifdef E_TYPEDEFS
|
||||||
|
|
||||||
|
EINTERN extern char *e_ipc_socket;
|
||||||
|
|
||||||
#ifdef USE_IPC
|
#ifdef USE_IPC
|
||||||
|
|
||||||
#define E_IPC_OP_EXEC_ACTION 386
|
#define E_IPC_OP_EXEC_ACTION 386
|
||||||
|
|
Loading…
Reference in New Issue