rsync 2.6.0 and Solaris 8

Bryan Blackburn blb at pobox.com
Mon Jan 19 04:25:22 GMT 2004


Trying to build rsync 2.6.0 on Solaris 8 (gcc 3.3.2) has revealed that
some of the EAI_ defines exist on Solaris, but not all of them.  This
causes lib/getaddrinfo.c to fail compilation as EAI_MAX (and some others)
is undefined.
The patch below fixes this issue, but I haven't tested the specific error
conditions represented by the defines.

Bryan


--- lib/addrinfo.h.orig	2001-12-05 06:19:16.000000000 -0700
+++ lib/addrinfo.h	2004-01-16 21:45:44.678112000 -0700
@@ -52,10 +52,12 @@
 #define	EAI_SERVICE	 9	/* servname not supported for ai_socktype */
 #define	EAI_SOCKTYPE	10	/* ai_socktype not supported */
 #define	EAI_SYSTEM	11	/* system error returned in errno */
+#endif /* ndef EAI_ADDRFAMILY */
+#ifndef EAI_BADHINTS
 #define EAI_BADHINTS	12
 #define EAI_PROTOCOL	13
 #define EAI_MAX		14
-#endif /* ndef EAI_ADDRFAMILY */
+#endif /* ndef EAI_BADHINTS */
 
 /*
  * Flag values for getaddrinfo()
@@ -66,8 +68,6 @@
 #define	AI_PASSIVE	0x00000001 /* get address to use bind() */
 #define	AI_CANONNAME	0x00000002 /* fill ai_canonname */
 #define	AI_NUMERICHOST	0x00000004 /* prevent name resolution */
-/* valid flags for addrinfo */
-#define	AI_MASK		(AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST)
 
 #define	AI_ALL		0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */
 #define	AI_V4MAPPED_CFG	0x00000200 /* accept IPv4-mapped if kernel supports */
@@ -105,6 +105,10 @@
 extern void freehostent(struct hostent *);
 extern char *gai_strerror(int);
 #endif /* AI_PASSIVE */
+#ifndef AI_MASK
+/* valid flags for addrinfo */
+#define	AI_MASK		(AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST)
+#endif /* ndef AI_MASK */
 #endif /* HAVE_GETADDRINFO */
 
 


More information about the rsync mailing list