mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 15:56:23 +01:00
ginetsocketaddress: Explicitly initialise flags for getaddrinfo()
This is not a functional change, as the hints field is static and hence automatically initialised to zero — which happens to be what AF_UNSPEC and the unspecified protocol are defined as. However, it’s best to be explicit about this, in case AF_UNSPEC is _not_ defined as zero. https://bugzilla.gnome.org/show_bug.cgi?id=732739
This commit is contained in:
parent
29c48f623f
commit
60226a0386
@ -361,7 +361,9 @@ g_inet_socket_address_new_from_string (const char *address,
|
|||||||
|
|
||||||
if (G_UNLIKELY (g_once_init_enter (&hints)))
|
if (G_UNLIKELY (g_once_init_enter (&hints)))
|
||||||
{
|
{
|
||||||
|
hints_struct.ai_family = AF_UNSPEC;
|
||||||
hints_struct.ai_socktype = SOCK_STREAM;
|
hints_struct.ai_socktype = SOCK_STREAM;
|
||||||
|
hints_struct.ai_protocol = 0;
|
||||||
hints_struct.ai_flags = AI_NUMERICHOST;
|
hints_struct.ai_flags = AI_NUMERICHOST;
|
||||||
g_once_init_leave (&hints, &hints_struct);
|
g_once_init_leave (&hints, &hints_struct);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user