summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-server-unix.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-04-18 04:18:57 +0000
committerHavoc Pennington <hp@redhat.com>2003-04-18 04:18:57 +0000
commit3df260c07102745c5606c313af862558f105f83e (patch)
treeb0a9d23fc820a3bc61da1cd7e63fc810423a2210 /dbus/dbus-server-unix.c
parent88cd5da3c0ec86fed29942b062c2f7bf0f8fda44 (diff)
2003-04-18 Havoc Pennington <hp@pobox.com>
* glib/dbus-gmain.c: adapt to watch changes * bus/bus.c, bus/activation.c, etc.: adjust to watch changes * dbus/dbus-server.h: remove dbus_server_handle_watch * dbus/dbus-connection.h: remove dbus_connection_handle_watch * dbus/dbus-watch.c (dbus_watch_handle): change DBusWatch to work like DBusTimeout, so we don't need dbus_connection_handle_watch etc.
Diffstat (limited to 'dbus/dbus-server-unix.c')
-rw-r--r--dbus/dbus-server-unix.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/dbus/dbus-server-unix.c b/dbus/dbus-server-unix.c
index c19e9596..fe4dbaa4 100644
--- a/dbus/dbus-server-unix.c
+++ b/dbus/dbus-server-unix.c
@@ -1,7 +1,7 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-server-unix.c Server implementation for Unix network protocols.
*
- * Copyright (C) 2002 Red Hat Inc.
+ * Copyright (C) 2002, 2003 Red Hat Inc.
*
* Licensed under the Academic Free License version 1.2
*
@@ -129,11 +129,12 @@ handle_new_client_fd (DBusServer *server,
}
static dbus_bool_t
-unix_handle_watch (DBusServer *server,
- DBusWatch *watch,
- unsigned int flags)
+unix_handle_watch (DBusWatch *watch,
+ unsigned int flags,
+ void *data)
{
- DBusServerUnix *unix_server = (DBusServerUnix*) server;
+ DBusServer *server = data;
+ DBusServerUnix *unix_server = data;
_dbus_assert (watch == unix_server->watch);
@@ -202,7 +203,6 @@ unix_disconnect (DBusServer *server)
static DBusServerVTable unix_vtable = {
unix_finalize,
- unix_handle_watch,
unix_disconnect
};
@@ -225,17 +225,19 @@ _dbus_server_new_for_fd (int fd,
{
DBusServerUnix *unix_server;
DBusWatch *watch;
+
+ unix_server = dbus_new0 (DBusServerUnix, 1);
+ if (unix_server == NULL)
+ return NULL;
watch = _dbus_watch_new (fd,
DBUS_WATCH_READABLE,
- TRUE);
+ TRUE,
+ unix_handle_watch, unix_server,
+ NULL);
if (watch == NULL)
- return NULL;
-
- unix_server = dbus_new0 (DBusServerUnix, 1);
- if (unix_server == NULL)
{
- _dbus_watch_unref (watch);
+ dbus_free (unix_server);
return NULL;
}