mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-05-03 04:26:52 +02:00
gsocketaddress: don't return ABSTRACT if the OS doesn't support it
FreeBSD apparently has non-0-length (but nameless) ANONYMOUS sockets. Fix the heuristics here.
This commit is contained in:
parent
aa10574dc3
commit
06b23e2b54
@ -260,7 +260,12 @@ g_socket_address_new_from_native (gpointer native,
|
|||||||
}
|
}
|
||||||
else if (addr->sun_path[0] == 0)
|
else if (addr->sun_path[0] == 0)
|
||||||
{
|
{
|
||||||
if (len < sizeof (*addr))
|
if (!g_unix_socket_address_abstract_names_supported ())
|
||||||
|
{
|
||||||
|
return g_unix_socket_address_new_with_type ("", 0,
|
||||||
|
G_UNIX_SOCKET_ADDRESS_ANONYMOUS);
|
||||||
|
}
|
||||||
|
else if (len < sizeof (*addr))
|
||||||
{
|
{
|
||||||
return g_unix_socket_address_new_with_type (addr->sun_path + 1,
|
return g_unix_socket_address_new_with_type (addr->sun_path + 1,
|
||||||
path_len - 1,
|
path_len - 1,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user