summaryrefslogtreecommitdiff
path: root/src/pulse
diff options
context:
space:
mode:
authorTanu Kaskinen <tanu.kaskinen@digia.com>2012-04-02 15:01:06 +0300
committerTanu Kaskinen <tanuk@iki.fi>2012-12-19 12:31:47 +0200
commit3ee3b0f49b3252785330a26d5dd624d8ae43e09c (patch)
treed98f9037751127c60ed50122bb28f750de0f6f46 /src/pulse
parent7e94a03e0c575726a21740b0f0cfdd6196eb40cb (diff)
mainloop: Check pa_write() return value.
Diffstat (limited to 'src/pulse')
-rw-r--r--src/pulse/mainloop.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pulse/mainloop.c b/src/pulse/mainloop.c
index f13c0f8e6..a3d7715d5 100644
--- a/src/pulse/mainloop.c
+++ b/src/pulse/mainloop.c
@@ -770,7 +770,10 @@ void pa_mainloop_wakeup(pa_mainloop *m) {
char c = 'W';
pa_assert(m);
- pa_write(m->wakeup_pipe[1], &c, sizeof(c), &m->wakeup_pipe_type);
+ if (pa_write(m->wakeup_pipe[1], &c, sizeof(c), &m->wakeup_pipe_type) < 0)
+ /* Not much options for recovering from the error. Let's at least log something. */
+ pa_log("pa_write() failed while trying to wake up the mainloop: %s", pa_cstrerror(errno));
+
pa_atomic_store(&m->wakeup_requested, TRUE);
}