diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-05-18 20:50:32 +0000 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-05-18 20:50:32 +0000 |
commit | e9e6822e7e4cfb2825ba06b74cbcfb200e546fe6 (patch) | |
tree | 424174e3751d4d2e034a8d731529c9f49155431a /serial | |
parent | 68f208cc3b17f8e26318ba411a0974d9489249c9 (diff) |
serial: send PortRemoved signal for RemovePort calls only
Diffstat (limited to 'serial')
-rw-r--r-- | serial/manager.c | 9 | ||||
-rw-r--r-- | serial/port.c | 9 |
2 files changed, 8 insertions, 10 deletions
diff --git a/serial/manager.c b/serial/manager.c index 0cf46a3d..3a64549d 100644 --- a/serial/manager.c +++ b/serial/manager.c @@ -885,8 +885,15 @@ static DBusHandlerResult remove_port(DBusConnection *conn, if (port_unregister(path) < 0) return err_does_not_exist(conn, msg, "Invalid RFCOMM node"); - return send_message_and_unref(conn, + send_message_and_unref(conn, dbus_message_new_method_return(msg)); + + dbus_connection_emit_signal(conn, SERIAL_MANAGER_PATH, + SERIAL_MANAGER_INTERFACE, "PortRemoved" , + DBUS_TYPE_STRING, &path, + DBUS_TYPE_INVALID); + + return DBUS_HANDLER_RESULT_HANDLED; } static DBusHandlerResult connect_service(DBusConnection *conn, diff --git a/serial/port.c b/serial/port.c index 49042785..64a72ff9 100644 --- a/serial/port.c +++ b/serial/port.c @@ -196,18 +196,9 @@ static gboolean rfcomm_disconnect_cb(GIOChannel *io, static void port_handler_unregister(DBusConnection *conn, void *data) { struct rfcomm_node *node = data; - char path[MAX_PATH_LENGTH]; - const char *ppath = path; debug("Unregistered serial port: %s", node->name); - snprintf(path, MAX_PATH_LENGTH, "%s/rfcomm%hd", SERIAL_MANAGER_PATH, node->id); - - dbus_connection_emit_signal(conn, SERIAL_MANAGER_PATH, - SERIAL_MANAGER_INTERFACE, "PortRemoved" , - DBUS_TYPE_STRING, &ppath, - DBUS_TYPE_INVALID); - bound_nodes = g_slist_remove(bound_nodes, node); rfcomm_node_free(node); } |