g_dbus_remove_watch function
PATCH 1/1 g_dbus_remove_watch function
this patch removes an unnecessary argument(D-Bus connection) of g_dbus_remove_watch.
Cheers,
Claudio
From 19a1a18c3ee8627f20d7a28dd266778c07546b8f Mon Sep 17 00:00:00 2001
From: Claudio Takahasi <[email protected]>
Date: Thu, 11 Feb 2010 16:47:37 -0200
Subject: [PATCH 1/1] Remove D-Bus connection argument of g_dbus_remove_watch function
--- audio/gateway.c | 2 +- audio/telephony-ofono.c | 8 ++++---- gdbus/gdbus.h | 2 +- gdbus/watch.c | 2 +- network/connection.c | 4 ++-- plugins/service.c | 4 ++-- serial/port.c | 10 +++++----- serial/proxy.c | 2 +- src/adapter.c | 2 +- src/agent.c | 2 +- src/device.c | 4 ++-- 11 files changed, 21 insertions(+), 21 deletions(-)
audio/gateway.c +1 -1
@@ -534,7 +534,7 @@ static DBusMessage *unregister_agent(DBusConnection *conn,ERROR_INTERFACE ".Failed" , "Unknown object path"); -g_dbus_remove_watch (device->conn, gw->agent->watch); +g_dbus_remove_watch (gw->agent->watch);agent_free (gw->agent); gw->agent =NULL ;
audio/telephony-ofono.c +4 -4
@@ -739,7 +739,7 @@ static void vc_free(struct voice_call *vc)if (!vc)return ; -g_dbus_remove_watch (connection, vc->watch); +g_dbus_remove_watch (vc->watch);g_free (vc->obj_path);g_free (vc->number);g_free (vc);
@@ -1090,9 +1090,9 @@ void telephony_exit(void)g_slist_free (calls); calls =NULL ; -g_dbus_remove_watch (connection, registration_watch); -g_dbus_remove_watch (connection, voice_watch); -g_dbus_remove_watch (connection, device_watch); +g_dbus_remove_watch (registration_watch); +g_dbus_remove_watch (voice_watch); +g_dbus_remove_watch (device_watch);dbus_connection_unref (connection); connection =NULL ;
gdbus/gdbus.h +1 -1
@@ -132,7 +132,7 @@ guint g_dbus_add_signal_watch(DBusConnection *connection, const char *interface, const char *member, GDBusSignalFunction function, void *user_data, GDBusDestroyFunction destroy); -gboolean g_dbus_remove_watch (DBusConnection *connection,guint tag); +gboolean g_dbus_remove_watch (guint tag);void g_dbus_remove_all_watches (DBusConnection *connection);#ifdef __cplusplus
gdbus/watch.c +1 -1
@@ -597,7 +597,7 @@ guint g_dbus_add_signal_watch(DBusConnection *connection,return cb->id; } -gboolean g_dbus_remove_watch (DBusConnection *connection,guint id) +gboolean g_dbus_remove_watch (guint id) {struct filter_data *data;struct filter_callback *cb;
network/connection.c +2 -2
@@ -165,7 +165,7 @@ static gboolean bnep_watchdog_cb(GIOChannel *chan, GIOCondition cond,device_remove_disconnect_watch (nc->peer->device, nc->dc_id); nc->dc_id =0 ;if (nc->watch) { -g_dbus_remove_watch (connection, nc->watch); +g_dbus_remove_watch (nc->watch); nc->watch =0 ; } }
@@ -185,7 +185,7 @@ static void cancel_connection(struct network_conn *nc, const char *err_msg)DBusMessage *reply;if (nc->watch) { -g_dbus_remove_watch (connection, nc->watch); +g_dbus_remove_watch (nc->watch); nc->watch =0 ; }
plugins/service.c +2 -2
@@ -501,7 +501,7 @@ static int remove_record(DBusConnection *conn, const char *sender,debug ("listner_id %d" , user_record->listener_id); -g_dbus_remove_watch (conn, user_record->listener_id); +g_dbus_remove_watch (user_record->listener_id);exit_callback (conn, user_record);
@@ -758,7 +758,7 @@ static void path_unregister(void *data) next = l->next; -g_dbus_remove_watch (connection, user_record->listener_id); +g_dbus_remove_watch (user_record->listener_id);exit_callback (connection, user_record); }
serial/port.c +5 -5
@@ -194,7 +194,7 @@ static void serial_port_free(struct serial_port *port)struct serial_device *device = port->device;if (device && port->listener_id >0 ) -g_dbus_remove_watch (device->conn, port->listener_id); +g_dbus_remove_watch (port->listener_id);port_release (port);
@@ -373,7 +373,7 @@ static void rfcomm_connect_cb(GIOChannel *chan, GError *conn_err, fail:g_dbus_send_message (device->conn, reply); -g_dbus_remove_watch (device->conn, port->listener_id); +g_dbus_remove_watch (port->listener_id); port->listener_id =0 ; }
@@ -433,7 +433,7 @@ static void get_record_cb(sdp_list_t *recs, int err, gpointer user_data)return ; failed: -g_dbus_remove_watch (device->conn, port->listener_id); +g_dbus_remove_watch (port->listener_id); port->listener_id =0 ;g_dbus_send_message (device->conn, reply); }
@@ -524,7 +524,7 @@ static DBusMessage *port_connect(DBusConnection *conn,DBusMessage *reply;error ("%s" ,strerror (-err)); -g_dbus_remove_watch (conn, port->listener_id); +g_dbus_remove_watch (port->listener_id); port->listener_id =0 ; reply =failed (msg,strerror (-err));return reply;
@@ -558,7 +558,7 @@ static DBusMessage *port_disconnect(DBusConnection *conn,port_release (port); -g_dbus_remove_watch (conn, port->listener_id); +g_dbus_remove_watch (port->listener_id); port->listener_id =0 ;return g_dbus_create_reply (msg,DBUS_TYPE_INVALID );
serial/proxy.c +1 -1
@@ -1022,7 +1022,7 @@ static void unregister_proxy(struct serial_proxy *proxy)char *path =g_strdup (proxy->path);if (proxy->watch >0 ) -g_dbus_remove_watch (adapter->conn, proxy->watch); +g_dbus_remove_watch (proxy->watch); g_dbus_emit_signal(adapter->conn, adapter_get_path(adapter->btd_adapter),
src/adapter.c +1 -1
@@ -648,7 +648,7 @@ static void session_free(struct session_req *req) req->mode ? "Mode" : "Discovery", req, req->owner);if (req->id) -g_dbus_remove_watch (req->conn, req->id); +g_dbus_remove_watch (req->id);session_remove (req);
src/agent.c +1 -1
@@ -176,7 +176,7 @@ void agent_free(struct agent *agent) }if (!agent->exited) { -g_dbus_remove_watch (connection, agent->listener_id); +g_dbus_remove_watch (agent->listener_id);agent_release (agent); }
src/device.c +2 -2
@@ -186,7 +186,7 @@ static inline DBusMessage *in_progress(DBusMessage *msg, const char *str)static void browse_request_free (struct browse_req *req) {if (req->listener_id) -g_dbus_remove_watch (req->conn, req->listener_id); +g_dbus_remove_watch (req->listener_id);if (req->msg)dbus_message_unref (req->msg);if (req->conn)
@@ -1639,7 +1639,7 @@ static void bonding_request_free(struct bonding_req *bonding)return ;if (bonding->listener_id) -g_dbus_remove_watch (bonding->conn, bonding->listener_id); +g_dbus_remove_watch (bonding->listener_id);if (bonding->msg)dbus_message_unref (bonding->msg);
Signature · 1 line
1.6.6.1
Marcel Holtmann
maintainerHi Claudio,
Quoted 2 lines
this patch removes an unnecessary argument(D-Bus connection) of
g_dbus_remove_watch.
I would prefer if we keep it. In theory we can open watches on per connection basis. And keep the watch id based on this connection.
Regards
Marcel