summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con/efl_net_server_unix.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-04-12 18:30:36 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-04-12 18:30:36 +0100
commit963c1b9adf4438ff26dcb4e132884058698b1330 (patch)
tree4372a5737ebacda12a28256a2a82f770c0d006b9 /src/lib/ecore_con/efl_net_server_unix.c
parentdcfb8bb580b70966911792588f06ab463fdc0f80 (diff)
ecore con - clean up file lock andunlock on failed bind
didnt do this if bind failed... so do it now.
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_con/efl_net_server_unix.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/lib/ecore_con/efl_net_server_unix.c b/src/lib/ecore_con/efl_net_server_unix.c
index 37d2c7302d..68f97a7619 100644
--- a/src/lib/ecore_con/efl_net_server_unix.c
+++ b/src/lib/ecore_con/efl_net_server_unix.c
@@ -111,20 +111,19 @@ _efl_net_server_unix_efl_object_destructor(Eo *o, Efl_Net_Server_Unix_Data *pd E
111 if (fd != INVALID_SOCKET) 111 if (fd != INVALID_SOCKET)
112 { 112 {
113 const char *address = efl_net_server_address_get(o); 113 const char *address = efl_net_server_address_get(o);
114 if ((address) && (strncmp(address, "abstract:", strlen("abstract:")) != 0)) 114 if ((address) &&
115 { 115 (strncmp(address, "abstract:", strlen("abstract:")) != 0))
116 unlink(address); 116 unlink(address);
117 }
117#ifdef BIND_HANG_WORKAROUND 118#ifdef BIND_HANG_WORKAROUND
118 if ((pd->have_lock_fd) && (pd->lock_fd >= 0)) 119 if ((pd->have_lock_fd) && (pd->lock_fd >= 0))
119 { 120 {
120 _efl_net_server_unix_bind_hang_lock_workaround 121 _efl_net_server_unix_bind_hang_lock_workaround
121 (address, EINA_FALSE, pd->lock_fd); 122 (address, EINA_FALSE, pd->lock_fd);
122 pd->lock_fd = -1; 123 pd->lock_fd = -1;
123 pd->have_lock_fd = EINA_FALSE; 124 pd->have_lock_fd = EINA_FALSE;
124 }
125#endif
126 }
127 } 125 }
126#endif
128 127
129 efl_destructor(efl_super(o, MY_CLASS)); 128 efl_destructor(efl_super(o, MY_CLASS));
130} 129}
@@ -264,6 +263,14 @@ _efl_net_server_unix_bind(Eo *o, Efl_Net_Server_Unix_Data *pd)
264 error: 263 error:
265 if (err) 264 if (err)
266 { 265 {
266#ifdef BIND_HANG_WORKAROUND
267 if ((pd->have_lock_fd) && (pd->lock_fd >= 0))
268 {
269 pd->lock_fd = _efl_net_server_unix_bind_hang_lock_workaround
270 (addr.sun_path, EINA_FALSE, -1);
271 pd->have_lock_fd = EINA_TRUE;
272 }
273#endif
267 efl_event_callback_call(o, EFL_NET_SERVER_EVENT_SERVER_ERROR, &err); 274 efl_event_callback_call(o, EFL_NET_SERVER_EVENT_SERVER_ERROR, &err);
268 if (fd != INVALID_SOCKET) closesocket(fd); 275 if (fd != INVALID_SOCKET) closesocket(fd);
269 efl_loop_fd_set(o, SOCKET_TO_LOOP_FD(INVALID_SOCKET)); 276 efl_loop_fd_set(o, SOCKET_TO_LOOP_FD(INVALID_SOCKET));