From 7f143a83c1a1b9b3654d2f3cfeab4f9e6362f1f4 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 14 Nov 2018 10:06:27 +0100 Subject: [PATCH] output/alsa: fix wrong use of `errno` alsa-lib doesn't set errno, it returns errors as negative integers. --- src/output/plugins/AlsaOutputPlugin.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }