support AF_UNIX in tests/unixsock.c

Rainer Weikusat rainer.weikusat at sncag.com
Mon Oct 31 16:17:26 GMT 2005


'Some systems' (at least Solaris 8, insofar I know of them) don't have
AF_LOCAL (or PF_LOCAL), but only AF_UNIX (PF_UNIX). Below is a small
patch for tests/unixsock.c that should make it work with either of
both.

--- eli-samba/source/tests/unixsock.c	27 Oct 2005 13:54:23 -0000	1.1
+++ eli-samba/source/tests/unixsock.c	31 Oct 2005 15:57:47 -0000	1.2
@@ -39,6 +39,22 @@
 extern int errno;
 #endif
 
+#ifndef AF_LOCAL
+#  ifdef AF_UNIX
+#    define AF_LOCAL AF_UNIX
+#  else
+#    error "found no AF_XXXX macro for local domain sockets"
+#  endif
+#endif
+
+#ifndef PF_LOCAL
+#  ifdef PF_UNIX
+#    define PF_LOCAL PF_UNIX
+#  else
+#    error "found no PF_XXXX macro for local domain sockets"
+#  endif
+#endif
+
 static int bind_socket(char const *filename)
 {
 	int sock_fd;


More information about the samba-technical mailing list