Skip to content

Commit 3b130ad

Browse files
dm0-gitster
authored andcommitted
git-compat-util.h: Provide missing netdb.h definitions
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7e20105 commit 3b130ad

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

daemon.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
#define HOST_NAME_MAX 256
1010
#endif
1111

12-
#ifndef NI_MAXSERV
13-
#define NI_MAXSERV 32
14-
#endif
15-
1612
#ifdef NO_INITGROUPS
1713
#define initgroups(x, y) (0) /* nothing */
1814
#endif

git-compat-util.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,17 @@ extern char *gitbasename(char *);
178178
#include <openssl/err.h>
179179
#endif
180180

181+
/* On most systems <netdb.h> would have given us this, but
182+
* not on some systems (e.g. z/OS).
183+
*/
184+
#ifndef NI_MAXHOST
185+
#define NI_MAXHOST 1025
186+
#endif
187+
188+
#ifndef NI_MAXSERV
189+
#define NI_MAXSERV 32
190+
#endif
191+
181192
/* On most systems <limits.h> would have given us this, but
182193
* not on some systems (e.g. GNU/Hurd).
183194
*/

0 commit comments

Comments
 (0)