reserve: update from upstream git repo
authorLennart Poettering <lennart@poettering.net>
Wed, 1 Jul 2009 18:20:36 +0000 (20:20 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 1 Jul 2009 18:20:36 +0000 (20:20 +0200)
src/modules/reserve-monitor.c
src/modules/reserve-monitor.h
src/modules/reserve.c
src/modules/reserve.h

index 64d2a7c..13ecde2 100644 (file)
@@ -1,3 +1,5 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: t -*-*/
+
 /***
   Copyright 2009 Lennart Poettering
 
@@ -76,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);
index 4f4a833..421a52e 100644 (file)
@@ -1,3 +1,5 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: t -*-*/
+
 #ifndef fooreservemonitorhfoo
 #define fooreservemonitorhfoo
 
 #include <dbus/dbus.h>
 #include <inttypes.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct rm_monitor rm_monitor;
 
 /* Prototype for a function that is called whenever the reservation
@@ -59,4 +65,8 @@ void rm_set_userdata(rm_monitor *m, void *userdata);
  * userdata was set. */
 void* rm_get_userdata(rm_monitor *m);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 09bc46c..5597f17 100644 (file)
@@ -1,3 +1,5 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: t -*-*/
+
 /***
   Copyright 2009 Lennart Poettering
 
index 3107129..9ae49cf 100644 (file)
@@ -1,3 +1,5 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: t -*-*/
+
 #ifndef fooreservehfoo
 #define fooreservehfoo
 
 #include <dbus/dbus.h>
 #include <inttypes.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct rd_device rd_device;
 
 /* Prototype for a function that is called whenever someone else wants
@@ -66,4 +72,8 @@ void rd_set_userdata(rd_device *d, void *userdata);
  * userdata was set. */
 void* rd_get_userdata(rd_device *d);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif