summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-11-14 10:06:27 +0100
committerMax Kellermann <max@musicpd.org>2018-11-14 10:07:23 +0100
commit7f143a83c1a1b9b3654d2f3cfeab4f9e6362f1f4 (patch)
tree52a53e63ee0f6e29ed35a94cacbef3617f552f93 /src
parent6ccc254179f21de82fb19afed48b047d147db9b2 (diff)
output/alsa: fix wrong use of `errno`
alsa-lib doesn't set errno, it returns errors as negative integers.
Diffstat (limited to 'src')
-rw-r--r--src/output/plugins/AlsaOutputPlugin.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx
index 01ad5e356..8932a02fb 100644
--- a/src/output/plugins/AlsaOutputPlugin.cxx
+++ b/src/output/plugins/AlsaOutputPlugin.cxx
@@ -727,7 +727,7 @@ AlsaOutput::DrainInternal()
/* drain period_buffer */
if (!period_buffer.IsEmpty()) {
auto frames_written = WriteFromPeriodBuffer();
- if (frames_written < 0 && errno != EAGAIN) {
+ if (frames_written < 0 && frames_written != -EAGAIN) {
CancelInternal();
return true;
}