diff --git a/src/output/plugins/SndioOutputPlugin.cxx b/src/output/plugins/SndioOutputPlugin.cxx index eac302a0d..e0897caca 100644 --- a/src/output/plugins/SndioOutputPlugin.cxx +++ b/src/output/plugins/SndioOutputPlugin.cxx @@ -17,7 +17,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include #include #include #include @@ -183,11 +182,11 @@ SndioOutput::Play(const void *chunk, size_t size, Error &error) while (1) { n = sio_write(sio_hdl, chunk, size); - if (n < 0) { - if (errno == EINTR) - continue; - error.FormatErrno("Failed to write %zu bytes to sndio output", size); - return 0; + if (n == 0) { + if (sio_eof(sio_hdl)) { + error.Set(sndio_output_domain, -1, "sndio write failed"); + return 0; + } } return n; }