diff options
author | Dan Winship <danw@gnome.org> | 2011-08-27 12:08:32 -0400 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2011-08-27 12:28:03 -0400 |
commit | 06b23e2b5416e994d29560436587a04b762e21cd (patch) | |
tree | 7bcd59bb0bee4c7e35e7b9a779f89fc0d597809d /gio | |
parent | aa10574dc37982457765783781f5e0e67015d4ae (diff) |
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.
Diffstat (limited to 'gio')
-rw-r--r-- | gio/gsocketaddress.c | 7 |
1 files changed, 6 insertions, 1 deletions
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, |