diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2006-11-08 20:50:54 +0000 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2006-11-08 20:50:54 +0000 |
commit | 55812d11e66379442cab94aaae1f62075c8b6f8d (patch) | |
tree | 750a6cae8d89fdadc9fa6d4a489d582279ab4192 /hcid/dbus-manager.c | |
parent | aec524d1be94e2745ef555214f21c1e9e2cf7684 (diff) |
handling sdp_connect error for service record registration
Diffstat (limited to 'hcid/dbus-manager.c')
-rw-r--r-- | hcid/dbus-manager.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/hcid/dbus-manager.c b/hcid/dbus-manager.c index 4697a51e..e538a738 100644 --- a/hcid/dbus-manager.c +++ b/hcid/dbus-manager.c @@ -236,6 +236,12 @@ static void autostart_reply(DBusPendingCall *pcall, void *udata) if (!dbus_set_error_from_message(&err, agent_reply)) { DBusMessage *message; + if (!call->agent) + goto fail; + + if (register_agent_records(call->agent->records) < 0) + goto fail; + /* Send a signal to indicate that the service started properly */ message = dbus_message_new_signal(dbus_message_get_path(call->msg), "org.bluez.Service", @@ -243,14 +249,11 @@ static void autostart_reply(DBusPendingCall *pcall, void *udata) send_message_and_unref(call->conn, message); - if (call->agent) { - call->agent->running = SERVICE_RUNNING; - register_agent_records(call->agent->records); - } + call->agent->running = SERVICE_RUNNING; } - +fail: dbus_message_unref(agent_reply); - dbus_pending_call_unref (pcall); + dbus_pending_call_unref(pcall); } static DBusHandlerResult register_service(DBusConnection *conn, |