summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pa.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/pa.c b/pa.c
index 9c01b55..3e44f73 100644
--- a/pa.c
+++ b/pa.c
@@ -362,10 +362,18 @@ con(Pulse *conn, int type __UNUSED__, Ecore_Con_Event_Server_Add *ev)
362 } 362 }
363 363
364#ifdef SO_PASSCRED 364#ifdef SO_PASSCRED
365 setsockopt(conn->fd, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)); 365 if (setsockopt(conn->fd, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)) < 0)
366 {
367 pulse_disconnect(conn);
368 return ECORE_CALLBACK_RENEW;
369 }
366#endif 370#endif
367 setsockopt(conn->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); 371 if ((setsockopt(conn->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0) ||
368 fcntl(conn->fd, F_SETFL, O_NONBLOCK); 372 (fcntl(conn->fd, F_SETFL, O_NONBLOCK) < 0))
373 {
374 pulse_disconnect(conn);
375 return ECORE_CALLBACK_RENEW;
376 }
369 377
370 flags = fcntl(conn->fd, F_GETFD); 378 flags = fcntl(conn->fd, F_GETFD);
371 flags |= FD_CLOEXEC; 379 flags |= FD_CLOEXEC;