summaryrefslogtreecommitdiff
path: root/src/modules/module-solaris.c
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2016-09-13 18:43:38 +0300
committerTanu Kaskinen <tanuk@iki.fi>2016-12-20 01:19:06 +0200
commit60695e3d84c98e4153edd5dda9dbf1dd7fde0de0 (patch)
treee52b7afffdc91dff9b035383951cd87a35b772c4 /src/modules/module-solaris.c
parent3e52972c610f0609c11e592c761379ea6ab8803f (diff)
don't assume that pa_asyncq_new() always succeeds
Bug 96741 shows a case where an assertion is hit, because pa_asyncq_new() failed due to running out of file descriptors. pa_asyncq_new() is used in only one place (not counting the call in asyncq-test): pa_asyncmsgq_new(). Now pa_asyncmsgq_new() can fail too, which requires error handling in many places. One of those places is pa_thread_mq_init(), which can now fail too, and that needs additional error handling in many more places. Luckily there weren't any places where adding better error handling wouldn't have been easy, so there are many changes in this patch, but they are not complicated. BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=96741
Diffstat (limited to 'src/modules/module-solaris.c')
-rw-r--r--src/modules/module-solaris.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/modules/module-solaris.c b/src/modules/module-solaris.c
index 2fa0bffa6..ccff69fc9 100644
--- a/src/modules/module-solaris.c
+++ b/src/modules/module-solaris.c
@@ -911,7 +911,11 @@ int pa__init(pa_module *m) {
pa_memchunk_reset(&u->memchunk);
u->rtpoll = pa_rtpoll_new();
- pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll);
+
+ if (pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll) < 0) {
+ pa_log("pa_thread_mq_init() failed.");
+ goto fail;
+ }
u->rtpoll_item = NULL;
build_pollfd(u);