Skip to content

Commit

Permalink
git-compat-util.h: Provide missing netdb.h definitions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Michael authored and Junio C Hamano committed Feb 25, 2013
1 parent 7e20105 commit 3b130ad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 0 additions & 4 deletions daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions git-compat-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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).
*/
Expand Down

0 comments on commit 3b130ad

Please sign in to comment.