From: Lennart Poettering Date: Mon, 6 Apr 2009 02:21:26 +0000 (+0200) Subject: don't fail device reservation if the D-Bus connection is dead X-Git-Tag: submit/2.0-panda/20130828.192557~1964 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=daa945aa324af5b71332a3cd07890d1cf3a1cb60;p=profile%2Fivi%2Fpulseaudio-panda.git don't fail device reservation if the D-Bus connection is dead --- diff --git a/src/modules/reserve-wrap.c b/src/modules/reserve-wrap.c index 1927342..02ff29b 100644 --- a/src/modules/reserve-wrap.c +++ b/src/modules/reserve-wrap.c @@ -23,6 +23,8 @@ #include #endif +#include + #include #include @@ -127,8 +129,13 @@ pa_reserve_wrapper* pa_reserve_wrapper_get(pa_core *c, const char *device_name) request_cb, NULL)) < 0) { - pa_log_error("Failed to acquire reservation lock on device '%s': %s", device_name, pa_cstrerror(-k)); - goto fail; + if (k == -EBUSY) { + pa_log_error("Device '%s' already locked.", device_name); + goto fail; + } else { + pa_log_warn("Failed to acquire reservation lock on device '%s': %s", device_name, pa_cstrerror(-k)); + return r; + } } pa_log_debug("Successfully acquired reservation lock on device '%s'", device_name);