Skip to content

Commit

Permalink
Fix net-server.c when AI_NUMERICSERV is undefined
Browse files Browse the repository at this point in the history
Some macOS versions do not define AI_NUMERICSERV.  Other source files
check whether it is defined before using it; do so here as well.

[ghudson@mit.edu: rewrote commit message; slightly changed approach]

(cherry picked from commit f8ecc0a)

ticket: 9062
version_fixed: 1.20.1
  • Loading branch information
barracuda156 authored and greghudson committed Nov 4, 2022
1 parent a7a99db commit 6401b30
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/apputils/net-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,10 @@ setup_addresses(verto_ctx *ctx, void *handle, const char *prog,
* resolution. */
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_family = AF_UNSPEC;
hints.ai_flags = AI_PASSIVE | AI_NUMERICSERV;
hints.ai_flags = AI_PASSIVE;
#ifdef AI_NUMERICSERV
hints.ai_flags |= AI_NUMERICSERV;
#endif

/* Add all the requested addresses. */
for (i = 0; i < bind_addresses.n; i++) {
Expand Down

0 comments on commit 6401b30

Please sign in to comment.