diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-07-01 19:15:15 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-07-01 19:15:15 +0200 |
commit | ff3aaeb766be7cdd9c67507dc69cd72af257aad5 (patch) | |
tree | 0f62740553413a927302849547e39066f7ed3da9 /reserve-monitor.c | |
parent | 3edbc3cd80745bfe17654d78917d563e2676c495 (diff) |
don't consider the device active if the local connection is the owner
Diffstat (limited to 'reserve-monitor.c')
-rw-r--r-- | reserve-monitor.c | 10 |
1 files changed, 9 insertions, 1 deletions
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); |