From 10a0350126bb517c36ac1d0d95e4995b6e303d8f Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Wed, 11 May 2011 15:36:34 +0200 Subject: [PATCH] Report error if read failed in bluetooth_playback_poll_revents --- audio/pcm_bluetooth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/audio/pcm_bluetooth.c b/audio/pcm_bluetooth.c index 2c21e058c..e633d1a48 100644 --- a/audio/pcm_bluetooth.c +++ b/audio/pcm_bluetooth.c @@ -820,7 +820,6 @@ static int bluetooth_playback_poll_revents(snd_pcm_ioplug_t *io, unsigned short *revents) { static char buf[1]; - int ret; DBG(""); @@ -831,7 +830,8 @@ static int bluetooth_playback_poll_revents(snd_pcm_ioplug_t *io, assert(pfds[1].fd >= 0); if (io->state != SND_PCM_STATE_PREPARED) - ret = read(pfds[0].fd, buf, 1); + if (read(pfds[0].fd, buf, 1) < 0) + SYSERR("read error: %s (%d)", strerror(errno), errno); if (pfds[1].revents & (POLLERR | POLLHUP | POLLNVAL)) io->state = SND_PCM_STATE_DISCONNECTED; -- 2.47.3