From a2335a65bb61313b3e46be861c90ca8bdb786eb8 Mon Sep 17 00:00:00 2001 From: Alok Barsode Date: Wed, 9 Jul 2008 13:19:43 +0530 Subject: Adding device_get_agent. Signed-off-by: Alok Barsode --- hcid/dbus-service.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'hcid/dbus-service.c') diff --git a/hcid/dbus-service.c b/hcid/dbus-service.c index edb3ab0c..66575d33 100644 --- a/hcid/dbus-service.c +++ b/hcid/dbus-service.c @@ -102,7 +102,11 @@ int service_req_auth(const bdaddr_t *src, const bdaddr_t *dst, if (!device) return -EPERM; - agent = (device->agent ? : adapter->agent); + agent = device_get_agent(device); + + if (!agent) + agent = adapter->agent; + if (!agent) return -EPERM; @@ -138,7 +142,11 @@ int service_cancel_auth(const bdaddr_t *src, const bdaddr_t *dst) * agent and in the meanwhile CreatePairedDevice is called. */ - agent = (device->agent ? : adapter->agent); + agent = device_get_agent(device); + + if (!agent) + agent = adapter->agent; + if (!agent) return -EPERM; -- cgit