diff options
author | Max Kellermann <max@duempel.org> | 2008-09-24 07:14:03 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-24 07:14:03 +0200 |
commit | ee1d723ad7ec94e0db09ae8bab61a8952bfaaa32 (patch) | |
tree | 77367e79bf0e57a65102c092933a2360ad658170 /src/notify.c | |
parent | 770b1405345710994b4d7fda55e26cad195c2742 (diff) | |
download | mpd-ee1d723ad7ec94e0db09ae8bab61a8952bfaaa32.tar.gz mpd-ee1d723ad7ec94e0db09ae8bab61a8952bfaaa32.tar.xz mpd-ee1d723ad7ec94e0db09ae8bab61a8952bfaaa32.zip |
notify: make notify_init() failures fatal
When a mutex cannot be created, there must be something very wrong.
Induce panic and abort MPD in this case.
Diffstat (limited to '')
-rw-r--r-- | src/notify.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/notify.c b/src/notify.c index 9a3ac500a..4f8a0d296 100644 --- a/src/notify.c +++ b/src/notify.c @@ -17,24 +17,21 @@ */ #include "notify.h" +#include "log.h" -int notify_init(struct notify *notify) +void notify_init(struct notify *notify) { int ret; ret = pthread_mutex_init(¬ify->mutex, NULL); if (ret != 0) - return ret; + FATAL("pthread_mutex_init() failed"); ret = pthread_cond_init(¬ify->cond, NULL); - if (ret != 0) { - pthread_mutex_destroy(¬ify->mutex); - return ret; - } + if (ret != 0) + FATAL("pthread_mutex_init() failed"); notify->pending = 0; - - return 0; } void notify_enter(struct notify *notify) |