diff options
Diffstat (limited to 'src/network/getservbyname_r.c')
-rw-r--r-- | src/network/getservbyname_r.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/network/getservbyname_r.c b/src/network/getservbyname_r.c index 5c025150..efa5d910 100644 --- a/src/network/getservbyname_r.c +++ b/src/network/getservbyname_r.c @@ -12,6 +12,10 @@ int getservbyname_r(const char *name, const char *prots, struct addrinfo *ai, hint = { .ai_family = AF_INET }; int i; + if (!prots) return -( + getservbyname_r(name, "tcp", se, buf, buflen, res) + && getservbyname_r(name, "udp", se, buf, buflen, res) ); + /* Align buffer */ i = (uintptr_t)buf & sizeof(char *)-1; if (!i) i = sizeof(char *); |