Skip to contentSkip to conversation

An interrupted syscall is not an error when returning from poll() in audio/pcm_bluetooth.c

PATCH In review Colin Didier 2 participants 4 messages Aug 25, 2010 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 An interrupted syscall is not an error when returning from poll() in audio/pcm_bluetooth.c

Hello,

An interrupted syscall is not an error when returning from poll() at line 240 of audio/pcm_bluetooth.c. So no need to freak out.

Here is a patch to fix this.

Cheers,
Colin DIDIER

audio/pcm_bluetooth.c +4 -2
@@ -237,9 +237,11 @@
 		ret = poll(fds, 2, poll_timeout);
 
 		if (ret < 0) {
-			SNDERR("poll error: %s (%d)", strerror(errno), errno);
-			if (errno != EINTR)
+			if (errno != EINTR) {
+				SNDERR("poll error: %s (%d)", strerror(errno),
+								errno);
 				break;
+			}
 		} else if (ret > 0) {
 			ret = (fds[0].revents) ? 0 : 1;
 			SNDERR("poll fd %d revents %d", ret, fds[ret].revents);
#1 lore raw

Hi Colin,

Quoted 4 lines · Colin Didier

An interrupted syscall is not an error when returning from poll() at line 240 of audio/pcm_bluetooth.c. So no need to freak out.

Here is a patch to fix this.

The patch itself seems fine, but the same comments apply for the commit message as with your other patch. I.e. prepare with git format-patch and make sure that you don't have overly long lines (e.g. the summary line is much too long in this one).

Johan

#2 lore raw

PATCH 1/1 No error message on interrupted syscall

An interrupted syscall is not an error when returning from poll().

---
 audio/pcm_bluetooth.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
audio/pcm_bluetooth.c +4 -2
index ff463fe..799f17f 100644
@@ -237,9 +237,11 @@ iter_sleep:
 		ret = poll(fds, 2, poll_timeout);
 
 		if (ret < 0) {
-			SNDERR("poll error: %s (%d)", strerror(errno), errno);
-			if (errno != EINTR)
+			if (errno != EINTR) {
+				SNDERR("poll error: %s (%d)", strerror(errno),
+								errno);
 				break;
+			}
 		} else if (ret > 0) {
 			ret = (fds[0].revents) ? 0 : 1;
 			SNDERR("poll fd %d revents %d", ret, fds[ret].revents);
Signature · 1 line
1.7.1
#3 lore raw

Re: [PATCH] No error message on interrupted syscall

Hi Colin,

Quoted 4 lines · Colin Didier

An interrupted syscall is not an error when returning from poll().

---
 audio/pcm_bluetooth.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

This one has also been pushed upstream. Thanks.

Johan