diff options
author | Keith Packard <keithp@keithp.com> | 2016-05-29 12:45:53 -0700 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2016-07-21 15:04:47 -0400 |
commit | 50779c494d4682103b96db440021e56e44311b6b (patch) | |
tree | 2992f667c34a9ee1a7a716aed385f9ef4f25cec3 /os | |
parent | f0275b1e5a4787da1f4d5507165315a000c22b33 (diff) |
os: Remove CheckConnections
poll provides per-fd notification of failure, so we don't need
CheckConnections anymore.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'os')
-rw-r--r-- | os/WaitFor.c | 6 | ||||
-rw-r--r-- | os/connection.c | 36 |
2 files changed, 2 insertions, 40 deletions
diff --git a/os/WaitFor.c b/os/WaitFor.c index 87f8abdd8..a5f581224 100644 --- a/os/WaitFor.c +++ b/os/WaitFor.c @@ -206,11 +206,7 @@ WaitForSomething(Bool are_ready) if (dispatchException) return FALSE; if (i < 0) { - if (pollerr == EBADF) { /* Some client disconnected */ - CheckConnections(); - return FALSE; - } - else if (pollerr == EINVAL) { + if (pollerr == EINVAL) { FatalError("WaitForSomething(): poll: %s\n", strerror(pollerr)); } diff --git a/os/connection.c b/os/connection.c index 26829ec0f..4294ee7eb 100644 --- a/os/connection.c +++ b/os/connection.c @@ -47,7 +47,7 @@ SOFTWARE. * Stuff to create connections --- OS dependent * * EstablishNewConnections, CreateWellKnownSockets, ResetWellKnownSockets, - * CloseDownConnection, CheckConnections + * CloseDownConnection, * OnlyListToOneClient, * ListenToAllClients, * @@ -78,7 +78,6 @@ SOFTWARE. #include <signal.h> #include <stdio.h> #include <stdlib.h> -#include <poll.h> #ifndef WIN32 #include <sys/socket.h> @@ -899,39 +898,6 @@ CloseDownFileDescriptor(OsCommPtr oc) } /***************** - * CheckConnections - * Some connection has died, go find which one and shut it down - * The file descriptor has been closed, but is still in AllClients. - * If would truly be wonderful if select() would put the bogus - * file descriptors in the exception mask, but nooooo. So we have - * to check each and every socket individually. - *****************/ - -void -CheckConnections(void) -{ - int i; - int r; - - for (i = 1; i < currentMaxClients; i++) { - ClientPtr client = clients[i]; - if (!client->clientGone) { - OsCommPtr oc = (OsCommPtr) client->osPrivate; - struct pollfd poll_fd; - - poll_fd.fd = oc->fd; - poll_fd.events = POLLIN|POLLOUT; - - do { - r = poll(&poll_fd, 1, 0); - } while (r < 0 && (errno == EINTR || errno == EAGAIN)); - if (r < 0) - CloseDownClient(client); - } - } -} - -/***************** * CloseDownConnection * Delete client from AllClients and free resources *****************/ |