summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--os/connection.c16
-rw-r--r--os/io.c4
-rw-r--r--os/osdep.h3
3 files changed, 12 insertions, 11 deletions
diff --git a/os/connection.c b/os/connection.c
index 66cb61070..a45a252a5 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -757,19 +757,22 @@ ErrorConnMax(XtransConnInfo trans_conn)
/************
* CloseDownFileDescriptor:
- * Remove this file descriptor and it's I/O buffers, etc.
+ * Remove this file descriptor
************/
-static void
+void
CloseDownFileDescriptor(OsCommPtr oc)
{
- int connection = oc->fd;
-
if (oc->trans_conn) {
+ int connection = oc->fd;
+#ifdef XDMCP
+ XdmcpCloseDisplay(connection);
+#endif
+ ospoll_remove(server_poll, connection);
_XSERVTransDisconnect(oc->trans_conn);
_XSERVTransClose(oc->trans_conn);
+ oc->trans_conn = NULL;
}
- ospoll_remove(server_poll, connection);
}
/*****************
@@ -787,9 +790,6 @@ CloseDownConnection(ClientPtr client)
if (oc->output)
FlushClient(client, oc, (char *) NULL, 0);
-#ifdef XDMCP
- XdmcpCloseDisplay(oc->fd);
-#endif
CloseDownFileDescriptor(oc);
FreeOsBuffers(oc);
free(client->osPrivate);
diff --git a/os/io.c b/os/io.c
index e1b90d17e..6a486613c 100644
--- a/os/io.c
+++ b/os/io.c
@@ -647,9 +647,7 @@ AbortClient(ClientPtr client)
OsCommPtr oc = client->osPrivate;
if (oc->trans_conn) {
- _XSERVTransDisconnect(oc->trans_conn);
- _XSERVTransClose(oc->trans_conn);
- oc->trans_conn = NULL;
+ CloseDownFileDescriptor(oc);
mark_client_ready(client);
}
}
diff --git a/os/osdep.h b/os/osdep.h
index c98b9a2a6..3ab81958c 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -133,6 +133,9 @@ extern int FlushClient(ClientPtr /*who */ ,
extern void FreeOsBuffers(OsCommPtr /*oc */
);
+void
+CloseDownFileDescriptor(OsCommPtr oc);
+
#include "dix.h"
#include "ospoll.h"