From 7ad3d4bc79c379f622ea80b1941c787cb2324ba0 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Thu, 16 Mar 2017 22:32:51 +0100 Subject: runloop: fix connection closure handling bug --- runloop.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'runloop.c') diff --git a/runloop.c b/runloop.c index d2865a2..30f28b2 100644 --- a/runloop.c +++ b/runloop.c @@ -1,4 +1,5 @@ #include +#include #include #include "runloop.h" @@ -39,11 +40,14 @@ void runloop_run(void){ if(fd_list[i].fd>maxfd)maxfd=fd_list[i].fd; } int ret=select(maxfd+1,&inset,NULL,NULL,NULL); - if(ret<=0)die_perror("select"); + if(ret<=0){ + if(errno==EINTR)continue; + die_perror("select"); + } for(size_t i=0;i