summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2017-05-17 09:57:27 -0700
committerAdam Jackson <ajax@redhat.com>2017-06-13 09:56:38 -0400
commit448a5586e9235bee9648d89e4103ed48e6237c15 (patch)
tree51bca7380c76d3046b6037d5c25bd384d663b729 /os
parent523d35e3e1c703a655386f6348a4bfb4291c3969 (diff)
os: Don't call ospoll_listen/ospoll_mute after connection is closed
In set_poll_client, check oc->trans_conn to make sure the connection is still running before changing the ospoll configuration of the file descriptor in case some other bit of the server is now using this file descriptor. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'os')
-rw-r--r--os/connection.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/os/connection.c b/os/connection.c
index a45a252a5..07c16eacf 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -1084,10 +1084,12 @@ set_poll_client(ClientPtr client)
{
OsCommPtr oc = (OsCommPtr) client->osPrivate;
- if (listen_to_client(client))
- ospoll_listen(server_poll, oc->fd, X_NOTIFY_READ);
- else
- ospoll_mute(server_poll, oc->fd, X_NOTIFY_READ);
+ if (oc->trans_conn) {
+ if (listen_to_client(client))
+ ospoll_listen(server_poll, oc->trans_conn->fd, X_NOTIFY_READ);
+ else
+ ospoll_mute(server_poll, oc->trans_conn->fd, X_NOTIFY_READ);
+ }
}
static void