check pulse mixer fd dup return

CID 1040123
This commit is contained in:
Mike Blumenkrantz 2014-04-04 13:36:11 -04:00
parent 789a0acbb1
commit ed4eb3b6e0
1 changed files with 3 additions and 1 deletions

View File

@ -353,12 +353,14 @@ con(Pulse *conn, int type __UNUSED__, Ecore_Con_Event_Server_Add *ev)
INF("connected to %s", ecore_con_server_name_get(ev->server));
fd = ecore_con_server_fd_get(ev->server);
if (fd >= -1)
conn->fd = dup(fd);
if (fd == -1)
{
pulse_disconnect(conn);
return ECORE_CALLBACK_RENEW;
}
conn->fd = dup(fd);
#ifdef SO_PASSCRED
setsockopt(conn->fd, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on));
#endif