[PATCH xserver 5/5] os: Set oc->fd to -1 when connection is closed

Keith Packard keithp at keithp.com
Wed May 17 16:57:29 UTC 2017


This ensures that we don't use the now-closed file descriptor in the
future.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 os/connection.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/os/connection.c b/os/connection.c
index 07c16eacf..229bbe745 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -772,6 +772,7 @@ CloseDownFileDescriptor(OsCommPtr oc)
         _XSERVTransDisconnect(oc->trans_conn);
         _XSERVTransClose(oc->trans_conn);
         oc->trans_conn = NULL;
+        oc->fd = -1;
     }
 }
 
-- 
2.11.0



More information about the xorg-devel mailing list