os: Set oc->fd to -1 when connection is closed

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

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Keith Packard 2017-05-17 09:57:29 -07:00 committed by Adam Jackson
parent d05c754e1b
commit f3689f637f

View File

@ -772,6 +772,7 @@ CloseDownFileDescriptor(OsCommPtr oc)
_XSERVTransDisconnect(oc->trans_conn);
_XSERVTransClose(oc->trans_conn);
oc->trans_conn = NULL;
oc->fd = -1;
}
}