summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-05-29 12:45:53 -0700
committerAdam Jackson <ajax@redhat.com>2016-07-21 15:04:47 -0400
commit50779c494d4682103b96db440021e56e44311b6b (patch)
tree2992f667c34a9ee1a7a716aed385f9ef4f25cec3
parentf0275b1e5a4787da1f4d5507165315a000c22b33 (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>
-rw-r--r--include/os.h2
-rw-r--r--os/WaitFor.c6
-rw-r--r--os/connection.c36
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
*****************/