diff mbox series

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

Message ID 20191015043650.23536-1-zev@bewilderbeest.net (mailing list archive)
State New, archived
Headers show
Series alsactl: don't exit on EINTR from epoll_wait(). | expand

Commit Message

Zev Weiss Oct. 15, 2019, 4:36 a.m. UTC
Previously, things like attaching strace to a running 'alsactl monitor'
process would cause it to exit.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
---
 alsactl/monitor.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Takashi Sakamoto April 12, 2020, 2:15 a.m. UTC | #1
On Mon, Oct 14, 2019 at 11:36:50PM -0500, Zev Weiss wrote:
> Previously, things like attaching strace to a running 'alsactl monitor'
> process would cause it to exit.
> 
> Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
> ---
>  alsactl/monitor.c | 2 ++
>  1 file changed, 2 insertions(+)
 
I'm sorry but I overlooked the post. It looks good to me.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Tested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

> diff --git a/alsactl/monitor.c b/alsactl/monitor.c
> index 6b090e4f5c92..cf4167bee165 100644
> --- a/alsactl/monitor.c
> +++ b/alsactl/monitor.c
> @@ -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;
>  		}
> -- 
> 2.23.0

Regards

Takashi Sakamoto
Jaroslav Kysela April 14, 2020, 1:24 p.m. UTC | #2
Dne 12. 04. 20 v 4:15 Takashi Sakamoto napsal(a):
> On Mon, Oct 14, 2019 at 11:36:50PM -0500, Zev Weiss wrote:
>> Previously, things like attaching strace to a running 'alsactl monitor'
>> process would cause it to exit.
>>
>> Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
>> ---
>>   alsactl/monitor.c | 2 ++
>>   1 file changed, 2 insertions(+)
>   
> I'm sorry but I overlooked the post. It looks good to me.
> 
> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
> Tested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
> 
>> diff --git a/alsactl/monitor.c b/alsactl/monitor.c
>> index 6b090e4f5c92..cf4167bee165 100644
>> --- a/alsactl/monitor.c
>> +++ b/alsactl/monitor.c
>> @@ -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;
>>   		}
>> -- 
>> 2.23.0
> 
> Regards
> 
> Takashi Sakamoto
>
diff mbox series

Patch

diff --git a/alsactl/monitor.c b/alsactl/monitor.c
index 6b090e4f5c92..cf4167bee165 100644
--- a/alsactl/monitor.c
+++ b/alsactl/monitor.c
@@ -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;
 		}