summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2006-08-24 17:40:24 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2006-08-24 17:40:24 -0700
commit5d006baadf213e91f131ffedc53c88a973fb1cba (patch)
treebca608da93f6e9f1a82f986f847310d2973be3c5
parent2495789d6c290e2037b2836f28b027786ea5b605 (diff)
Use SUN_LEN if it is defined on non-BSD44SOCKETS systems
-rw-r--r--Xtranssock.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Xtranssock.c b/Xtranssock.c
index a144e08..309f345 100644
--- a/Xtranssock.c
+++ b/Xtranssock.c
@@ -1106,6 +1106,9 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__)) && !defined(Lynx)
sockname.sun_len = strlen(sockname.sun_path);
+#endif
+
+#if defined(BSD44SOCKETS) || defined(SUN_LEN)
namelen = SUN_LEN(&sockname);
#else
namelen = strlen(sockname.sun_path) + offsetof(struct sockaddr_un, sun_path);
@@ -1996,6 +1999,9 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__)) && !defined(Lynx)
sockname.sun_len = strlen (sockname.sun_path);
+#endif
+
+#if defined(BSD44SOCKETS) || defined(SUN_LEN)
namelen = SUN_LEN (&sockname);
#else
namelen = strlen (sockname.sun_path) + offsetof(struct sockaddr_un, sun_path);