Set optlen before calling getsockopt

We were sometimes failing in g_socket_check_pending_error because
we were not setting optlen on input and it was sometimes randomly
less than sizeof(int).
This commit is contained in:
Alexander Larsson 2009-05-14 16:19:07 +02:00
parent 145cec3c93
commit 7ffdc91f51

View File

@ -1501,6 +1501,7 @@ g_socket_check_pending_error (GSocket *socket,
guint optlen;
int value;
optlen = sizeof (value);
if (getsockopt (socket->priv->fd, SOL_SOCKET, SO_ERROR, (void *)&value, &optlen) != 0)
{
int errsv = get_socket_errno ();