diff options
author | Alok Barsode <alok.barsode@azingo.com> | 2008-07-09 13:19:43 +0530 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.dentz@indt.org.br> | 2008-07-28 10:34:42 -0300 |
commit | a2335a65bb61313b3e46be861c90ca8bdb786eb8 (patch) | |
tree | 0b3a6bc85393de6d4608013b6cb3eb2b1ba9d361 /hcid/dbus-service.c | |
parent | 46fd7beaa5b27f74e64d77449247e5459d7a3084 (diff) |
Adding device_get_agent.
Signed-off-by: Alok Barsode <alok.barsode@azingo.com>
Diffstat (limited to 'hcid/dbus-service.c')
-rw-r--r-- | hcid/dbus-service.c | 12 |
1 files changed, 10 insertions, 2 deletions
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; |