diff options
author | Rich Coe <Richard.Coe@med.ge.com> | 2007-12-05 19:36:37 +0000 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2007-12-05 19:36:37 +0000 |
commit | b7f3618f3933a810778093fd47564a1e3bf3fde6 (patch) | |
tree | 52c21dbd45caa23d4db8fb9077c8279cef506e84 /os/connection.c | |
parent | d8b2cad3771a09860e7be1726f67e684cf7caeec (diff) |
OS: Connection: Keep trying select while it gets interrupted (bug #9240)
If we got interrupted (EINTR or EAGAIN) during select, just try again, rather
than shutting clients down on either of these errors.
Diffstat (limited to 'os/connection.c')
-rw-r--r-- | os/connection.c | 13 |
1 files changed, 9 insertions, 4 deletions
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 } |