diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2006-09-22 10:53:41 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2006-09-22 10:53:41 +0000 |
commit | 4a3ecd87295f9388b996e67ef61dc225c6232883 (patch) | |
tree | f2f377582aa20113cb165626a413a002a91b6682 | |
parent | 8b1ff2f061db8120a14f7f664f83b2412f7b283b (diff) |
Check that the caller of RFCOMM.Connect is still present before returning a successful reply
-rw-r--r-- | hcid/dbus-rfcomm.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/hcid/dbus-rfcomm.c b/hcid/dbus-rfcomm.c index d0c28cdb..5d39c327 100644 --- a/hcid/dbus-rfcomm.c +++ b/hcid/dbus-rfcomm.c @@ -262,6 +262,12 @@ static void rfcomm_connect_cb_devnode_opened(int fd, struct pending_connect *c, goto failed; } + /* Check if the caller is still present */ + if (!dbus_bus_name_has_owner(c->conn, node->owner, NULL)) { + error("RFCOMM.Connect requestor %s exited"); + goto failed; + } + node->io = g_io_channel_unix_new(fd); g_io_channel_set_close_on_unref(node->io, TRUE); node->io_id = g_io_add_watch(node->io, G_IO_ERR | G_IO_HUP, |