Make audio_acquire() fail if audio_reservation_init() fails.

rd_acquire() is going to assert (or fail) anyway because connection will be NULL.
This commit is contained in:
Nedko Arnaudov 2013-04-06 22:00:52 +03:00
parent 9d3524006a
commit 8f556dac4f
1 changed files with 5 additions and 2 deletions

View File

@ -71,8 +71,11 @@ SERVER_EXPORT bool audio_acquire(const char * device_name)
int ret;
// Open DBus connection first time
if (gReserveCount == 0)
audio_reservation_init();
if (gReserveCount == 0) {
if (audio_reservation_init() != 0) {
return false;
}
}
assert(gReserveCount < DEVICE_MAX);