summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-09-13 07:19:07 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-09-13 07:19:07 +0000
commitc9cb0263c7b04986f9c1a4b5eea3b703dd6227e2 (patch)
tree9f3b8233fb5bd1c313d3c5c9382adf5026f86297
parent3a6a7c6bd530c44106e51a50e0193517078dfb44 (diff)
emit pulse failure event when server connection fails
SVN revision: 76585
-rw-r--r--pa.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/pa.c b/pa.c
index 8593acb..01fab40 100644
--- a/pa.c
+++ b/pa.c
@@ -345,11 +345,20 @@ static Eina_Bool
345con(Pulse *conn, int type __UNUSED__, Ecore_Con_Event_Server_Add *ev) 345con(Pulse *conn, int type __UNUSED__, Ecore_Con_Event_Server_Add *ev)
346{ 346{
347 int on = 1; 347 int on = 1;
348 int fd;
348 349
349 if (conn != ecore_con_server_data_get(ev->server)) return ECORE_CALLBACK_PASS_ON; 350 if (conn != ecore_con_server_data_get(ev->server)) return ECORE_CALLBACK_PASS_ON;
350 INF("connected to %s", ecore_con_server_name_get(ev->server)); 351 INF("connected to %s", ecore_con_server_name_get(ev->server));
351 352
352 conn->fd = dup(ecore_con_server_fd_get(ev->server)); 353 fd = ecore_con_server_fd_get(ev->server);
354 if (fd == -1)
355 {
356 conn->state = PA_STATE_INIT;
357 ecore_con_server_del(ev->server);
358 ecore_event_add(PULSE_EVENT_DISCONNECTED, conn, pulse_fake_free, NULL);
359 return ECORE_CALLBACK_RENEW;
360 }
361 conn->fd = dup(fd);
353#ifdef SO_PASSCRED 362#ifdef SO_PASSCRED
354 setsockopt(conn->fd, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)); 363 setsockopt(conn->fd, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on));
355#endif 364#endif