Skip to contentSkip to conversation

alsactl: don't exit on EINTR from epoll_wait().

PATCH In review Zev Weiss 3 participants 3 messages Oct 17, 2019 – Apr 14, 2020

lore
Share & tools
lore

Zev Weiss

author
#0 lore raw

PATCH 1/1 alsactl: don't exit on EINTR from epoll_wait().

Previously, things like attaching strace to a running 'alsactl monitor' process would cause it to exit.

---
 alsactl/monitor.c | 2 ++
 1 file changed, 2 insertions(+)
alsactl/monitor.c +2 -0
index 6b090e4f5c92..cf4167bee165 100644
@@ -342,6 +342,8 @@ static int run_dispatcher(int epfd, int sigfd, int infd, struct list_head *srcs,
 
 		count = epoll_wait(epfd, epev, max_ev_count, 200);
 		if (count < 0) {
+			if (errno == EINTR)
+				continue;
 			err = count;
 			break;
 		}
Signature · 6 lines
2.23.0

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 7 lines · Zev Weiss

Previously, things like attaching strace to a running 'alsactl monitor' process would cause it to exit.

---
 alsactl/monitor.c | 2 ++
 1 file changed, 2 insertions(+)

I'm sorry but I overlooked the post. It looks good to me.

Quoted 15 lines
alsactl/monitor.c +2 -0
index 6b090e4f5c92..cf4167bee165 100644
@@ -342,6 +342,8 @@ static int run_dispatcher(int epfd, int sigfd, int infd, struct list_head *srcs,
 
 		count = epoll_wait(epfd, epev, max_ev_count, 200);
 		if (count < 0) {
+			if (errno == EINTR)
+				continue;
 			err = count;
 			break;
 		}
Signature · 1 line
2.23.0

Regards

Takashi Sakamoto

#2 lore raw

Dne 12. 04. 20 v 4:15 Takashi Sakamoto napsal(a):

Quoted 34 lines · Zev Weiss
Quoted 7 lines

Previously, things like attaching strace to a running 'alsactl monitor' process would cause it to exit.

---
  alsactl/monitor.c | 2 ++
  1 file changed, 2 insertions(+)

I'm sorry but I overlooked the post. It looks good to me.

Quoted 15 lines
alsactl/monitor.c +2 -0
index 6b090e4f5c92..cf4167bee165 100644
@@ -342,6 +342,8 @@ static int run_dispatcher(int epfd, int sigfd, int infd, struct list_head *srcs,
 
  		count = epoll_wait(epfd, epev, max_ev_count, 200);
  		if (count < 0) {
+			if (errno == EINTR)
+				continue;
  			err = count;
  			break;
  		}
Signature · 1 line
2.23.0

Regards

Takashi Sakamoto

Signature · 2 lines
Jaroslav Kysela <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.