dbus: Fix event handling

The port to glib failed to actually watch the file descriptor for events and
thus awesome silently ignored all dbus messages. My bad.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2012-11-21 22:05:15 +01:00
parent ea30119410
commit bfcb1628b7
1 changed files with 5 additions and 3 deletions

8
dbus.c
View File

@ -494,7 +494,7 @@ a_dbus_process_requests_on_bus(DBusConnection *dbus_connection, GSource **source
* \param revents (not used) * \param revents (not used)
*/ */
static gboolean static gboolean
a_dbus_process_requests_session(GIOChannel *source, GIOCondition cond, gpointer data) a_dbus_process_requests_session(gpointer data)
{ {
a_dbus_process_requests_on_bus(dbus_connection_session, &session_source); a_dbus_process_requests_on_bus(dbus_connection_session, &session_source);
return TRUE; return TRUE;
@ -505,7 +505,7 @@ a_dbus_process_requests_session(GIOChannel *source, GIOCondition cond, gpointer
* \param revents (not used) * \param revents (not used)
*/ */
static gboolean static gboolean
a_dbus_process_requests_system(GIOChannel *source, GIOCondition cond, gpointer data) a_dbus_process_requests_system(gpointer data)
{ {
a_dbus_process_requests_on_bus(dbus_connection_system, &system_source); a_dbus_process_requests_on_bus(dbus_connection_system, &system_source);
return TRUE; return TRUE;
@ -592,7 +592,7 @@ a_dbus_release_name(DBusConnection *dbus_connection, const char *name)
* \return The requested D-Bus connection on success, NULL on failure. * \return The requested D-Bus connection on success, NULL on failure.
*/ */
static DBusConnection * static DBusConnection *
a_dbus_connect(DBusBusType type, const char *type_name, GIOFunc cb, GSource **source) a_dbus_connect(DBusBusType type, const char *type_name, GSourceFunc cb, GSource **source)
{ {
int fd; int fd;
DBusConnection *dbus_connection; DBusConnection *dbus_connection;
@ -615,6 +615,8 @@ a_dbus_connect(DBusBusType type, const char *type_name, GIOFunc cb, GSource **so
GIOChannel *channel = g_io_channel_unix_new(fd); GIOChannel *channel = g_io_channel_unix_new(fd);
*source = g_io_create_watch(channel, G_IO_IN); *source = g_io_create_watch(channel, G_IO_IN);
g_io_channel_unref(channel); g_io_channel_unref(channel);
g_source_set_callback(*source, cb, NULL, NULL);
g_source_attach(*source, NULL);
fcntl(fd, F_SETFD, FD_CLOEXEC); fcntl(fd, F_SETFD, FD_CLOEXEC);
} }