reserve: update from upstream git repo

This commit is contained in:
Lennart Poettering 2009-07-01 20:20:36 +02:00
parent 5d4769b7dd
commit efdd3d054b
4 changed files with 33 additions and 1 deletions

View file

@ -1,3 +1,5 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: t -*-*/
/*** /***
Copyright 2009 Lennart Poettering Copyright 2009 Lennart Poettering
@ -76,9 +78,17 @@ static DBusHandlerResult filter_handler(
goto invalid; goto invalid;
if (strcmp(name, m->service_name) == 0) { if (strcmp(name, m->service_name) == 0) {
m->busy = !!(new && *new); 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) { if (m->change_cb) {
m->ref++; m->ref++;
m->change_cb(m); m->change_cb(m);

View file

@ -1,3 +1,5 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: t -*-*/
#ifndef fooreservemonitorhfoo #ifndef fooreservemonitorhfoo
#define fooreservemonitorhfoo #define fooreservemonitorhfoo
@ -28,6 +30,10 @@
#include <dbus/dbus.h> #include <dbus/dbus.h>
#include <inttypes.h> #include <inttypes.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct rm_monitor rm_monitor; typedef struct rm_monitor rm_monitor;
/* Prototype for a function that is called whenever the reservation /* 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. */ * userdata was set. */
void* rm_get_userdata(rm_monitor *m); void* rm_get_userdata(rm_monitor *m);
#ifdef __cplusplus
}
#endif
#endif #endif

View file

@ -1,3 +1,5 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: t -*-*/
/*** /***
Copyright 2009 Lennart Poettering Copyright 2009 Lennart Poettering

View file

@ -1,3 +1,5 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: t -*-*/
#ifndef fooreservehfoo #ifndef fooreservehfoo
#define fooreservehfoo #define fooreservehfoo
@ -28,6 +30,10 @@
#include <dbus/dbus.h> #include <dbus/dbus.h>
#include <inttypes.h> #include <inttypes.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct rd_device rd_device; typedef struct rd_device rd_device;
/* Prototype for a function that is called whenever someone else wants /* 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. */ * userdata was set. */
void* rd_get_userdata(rd_device *d); void* rd_get_userdata(rd_device *d);
#ifdef __cplusplus
}
#endif
#endif #endif