forked from enlightenment/efl
ecore con - clean up file lock andunlock on failed bind
didnt do this if bind failed... so do it now.
This commit is contained in:
parent
dcfb8bb580
commit
963c1b9adf
|
@ -111,20 +111,19 @@ _efl_net_server_unix_efl_object_destructor(Eo *o, Efl_Net_Server_Unix_Data *pd E
|
|||
if (fd != INVALID_SOCKET)
|
||||
{
|
||||
const char *address = efl_net_server_address_get(o);
|
||||
if ((address) && (strncmp(address, "abstract:", strlen("abstract:")) != 0))
|
||||
{
|
||||
unlink(address);
|
||||
#ifdef BIND_HANG_WORKAROUND
|
||||
if ((pd->have_lock_fd) && (pd->lock_fd >= 0))
|
||||
{
|
||||
_efl_net_server_unix_bind_hang_lock_workaround
|
||||
(address, EINA_FALSE, pd->lock_fd);
|
||||
pd->lock_fd = -1;
|
||||
pd->have_lock_fd = EINA_FALSE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if ((address) &&
|
||||
(strncmp(address, "abstract:", strlen("abstract:")) != 0))
|
||||
unlink(address);
|
||||
}
|
||||
#ifdef BIND_HANG_WORKAROUND
|
||||
if ((pd->have_lock_fd) && (pd->lock_fd >= 0))
|
||||
{
|
||||
_efl_net_server_unix_bind_hang_lock_workaround
|
||||
(address, EINA_FALSE, pd->lock_fd);
|
||||
pd->lock_fd = -1;
|
||||
pd->have_lock_fd = EINA_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
efl_destructor(efl_super(o, MY_CLASS));
|
||||
}
|
||||
|
@ -264,6 +263,14 @@ _efl_net_server_unix_bind(Eo *o, Efl_Net_Server_Unix_Data *pd)
|
|||
error:
|
||||
if (err)
|
||||
{
|
||||
#ifdef BIND_HANG_WORKAROUND
|
||||
if ((pd->have_lock_fd) && (pd->lock_fd >= 0))
|
||||
{
|
||||
pd->lock_fd = _efl_net_server_unix_bind_hang_lock_workaround
|
||||
(addr.sun_path, EINA_FALSE, -1);
|
||||
pd->have_lock_fd = EINA_TRUE;
|
||||
}
|
||||
#endif
|
||||
efl_event_callback_call(o, EFL_NET_SERVER_EVENT_SERVER_ERROR, &err);
|
||||
if (fd != INVALID_SOCKET) closesocket(fd);
|
||||
efl_loop_fd_set(o, SOCKET_TO_LOOP_FD(INVALID_SOCKET));
|
||||
|
|
Loading…
Reference in New Issue