socket: set fd field to -1 after closing socket

This ensures that g_socket_get_fd() will return -1 after the socket has
been closed.

https://bugzilla.gnome.org/show_bug.cgi?id=765959
This commit is contained in:
Christian Hergert
2016-05-04 10:40:50 +03:00
parent 0cd3d5741b
commit c16a0b53fe
2 changed files with 5 additions and 0 deletions

View File

@@ -3285,6 +3285,7 @@ g_socket_close (GSocket *socket,
break;
}
socket->priv->fd = -1;
socket->priv->connected_read = FALSE;
socket->priv->connected_write = FALSE;
socket->priv->closed = TRUE;