ecore-con now prints error messages when local socket creation fails

This commit is contained in:
Mike Blumenkrantz 2014-12-05 13:19:49 -05:00
parent 9cd2d614e9
commit 08e1f2f4f3
1 changed files with 12 additions and 5 deletions

View File

@ -371,14 +371,21 @@ start:
if (bind(svr->fd, (struct sockaddr *)&socket_unix, socket_unix_len) < 0)
{
ERR("Local socket '%s' bind failed: %s", buf, strerror(errno));
if ((((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_USER) ||
((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_SYSTEM)) &&
(connect(svr->fd, (struct sockaddr *)&socket_unix,
socket_unix_len) < 0) &&
(unlink(buf) >= 0))
goto start;
else
goto error_umask;
socket_unix_len) < 0))
{
ERR("Local socket '%s' connect test failed: %s", buf, strerror(errno));
if (unlink(buf) >= 0)
goto start;
else
{
ERR("Local socket '%s' removal failed: %s", buf, strerror(errno));
goto error_umask;
}
}
}
if (listen(svr->fd, 4096) < 0)