From 06b23e2b5416e994d29560436587a04b762e21cd Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Sat, 27 Aug 2011 12:08:32 -0400 Subject: 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. --- gio/gsocketaddress.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gio') diff --git a/gio/gsocketaddress.c b/gio/gsocketaddress.c index d4dcbb047..5d4ed267d 100644 --- a/gio/gsocketaddress.c +++ b/gio/gsocketaddress.c @@ -260,7 +260,12 @@ g_socket_address_new_from_native (gpointer native, } 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, path_len - 1, -- cgit v1.2.3