mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-14 19:55:12 +01:00
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:
parent
145cec3c93
commit
7ffdc91f51
@ -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 ();
|
||||
|
Loading…
x
Reference in New Issue
Block a user