git-compat-util.h: Provide missing netdb.h definitions
authorDavid Michael <fedora.dm0@gmail.com>
Mon, 25 Feb 2013 19:30:19 +0000 (14:30 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Feb 2013 20:16:08 +0000 (12:16 -0800)
Some platforms may lack the NI_MAXHOST and NI_MAXSERV values in their
system headers, so ensure they are available.

Signed-off-by: David Michael <fedora.dm0@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
daemon.c
git-compat-util.h
index ab21e66b2fb69015c3085761b344b11053c67f4a..34d95c1674930aa6ea429f7ee9173c239aae6bd5 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -9,10 +9,6 @@
 #define HOST_NAME_MAX 256
 #endif
 
-#ifndef NI_MAXSERV
-#define NI_MAXSERV 32
-#endif
-
 #ifdef NO_INITGROUPS
 #define initgroups(x, y) (0) /* nothing */
 #endif
index 000042d79352b4a7bb789d60e5324af92f29871a..503282c863965bf54f6013b34a4a8d55e34c4932 100644 (file)
@@ -178,6 +178,17 @@ extern char *gitbasename(char *);
 #include <openssl/err.h>
 #endif
 
+/* On most systems <netdb.h> would have given us this, but
+ * not on some systems (e.g. z/OS).
+ */
+#ifndef NI_MAXHOST
+#define NI_MAXHOST 1025
+#endif
+
+#ifndef NI_MAXSERV
+#define NI_MAXSERV 32
+#endif
+
 /* On most systems <limits.h> would have given us this, but
  * not on some systems (e.g. GNU/Hurd).
  */