diff --git a/os/connection.c b/os/connection.c index 6012a8e81..be7521f3d 100644 --- a/os/connection.c +++ b/os/connection.c @@ -1057,7 +1057,9 @@ CheckConnections(void) curclient = curoff + (i * (sizeof(fd_mask)*8)); FD_ZERO(&tmask); FD_SET(curclient, &tmask); - r = Select (curclient + 1, &tmask, NULL, NULL, ¬ime); + do { + r = Select (curclient + 1, &tmask, NULL, NULL, ¬ime); + } while (r < 0 && (errno == EINTR || errno == EAGAIN)); if (r < 0) if (ConnectionTranslation[curclient] > 0) CloseDownClient(clients[ConnectionTranslation[curclient]]); @@ -1071,9 +1073,12 @@ CheckConnections(void) curclient = XFD_FD(&savedAllClients, i); FD_ZERO(&tmask); FD_SET(curclient, &tmask); - r = Select (curclient + 1, &tmask, NULL, NULL, ¬ime); - if (r < 0 && GetConnectionTranslation(curclient) > 0) - CloseDownClient(clients[GetConnectionTranslation(curclient)]); + do { + r = Select (curclient + 1, &tmask, NULL, NULL, ¬ime); + } while (r < 0 && (errno == EINTR || errno == EAGAIN)); + if (r < 0) + if (GetConnectionTranslation(curclient) > 0) + CloseDownClient(clients[GetConnectionTranslation(curclient)]); } #endif }