diff options
-rw-r--r-- | include/os.h | 2 | ||||
-rw-r--r-- | os/WaitFor.c | 6 | ||||
-rw-r--r-- | os/connection.c | 36 |
3 files changed, 2 insertions, 42 deletions
diff --git a/include/os.h b/include/os.h index 765562c80..d2c41b402 100644 --- a/include/os.h +++ b/include/os.h @@ -141,8 +141,6 @@ extern _X_EXPORT const char *ClientAuthorized(ClientPtr /*client */ , unsigned int /*string_n */ , char * /*auth_string */ ); -extern _X_EXPORT void CheckConnections(void); - extern _X_EXPORT void CloseDownConnection(ClientPtr /*client */ ); typedef void (*NotifyFdProcPtr)(int fd, int ready, void *data); 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 *****************/ |