From ff3aaeb766be7cdd9c67507dc69cd72af257aad5 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 1 Jul 2009 19:15:15 +0200 Subject: don't consider the device active if the local connection is the owner --- reserve-monitor.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/reserve-monitor.c b/reserve-monitor.c index 39cb620..9f60201 100644 --- a/reserve-monitor.c +++ b/reserve-monitor.c @@ -78,9 +78,17 @@ static DBusHandlerResult filter_handler( goto invalid; if (strcmp(name, m->service_name) == 0) { - m->busy = !!(new && *new); + /* If we ourselves own the device, then don't consider this 'busy' */ + if (m->busy) { + const char *un; + + if ((un = dbus_bus_get_unique_name(c))) + if (strcmp(new, un) == 0) + m->busy = FALSE; + } + if (m->change_cb) { m->ref++; m->change_cb(m); -- cgit