Commit 6b5d6c93 authored by Hendrik Leppkes's avatar Hendrik Leppkes

Merge commit '00b62968'

* commit '00b62968':
  os_support: Don't try to return the service name as a string in getnameinfo
Merged-by: 's avatarHendrik Leppkes <h.leppkes@gmail.com>
parents 9dc9b7e6 00b62968
...@@ -1808,7 +1808,6 @@ SYSTEM_FUNCS=" ...@@ -1808,7 +1808,6 @@ SYSTEM_FUNCS="
GetProcessMemoryInfo GetProcessMemoryInfo
GetProcessTimes GetProcessTimes
getrusage getrusage
getservbyport
GetSystemTimeAsFileTime GetSystemTimeAsFileTime
gettimeofday gettimeofday
glob glob
...@@ -5106,7 +5105,6 @@ nvenc_encoder_extralibs='$ldl' ...@@ -5106,7 +5105,6 @@ nvenc_encoder_extralibs='$ldl'
if ! disabled network; then if ! disabled network; then
check_func getaddrinfo $network_extralibs check_func getaddrinfo $network_extralibs
check_func getservbyport $network_extralibs
check_func inet_aton $network_extralibs check_func inet_aton $network_extralibs
check_type netdb.h "struct addrinfo" check_type netdb.h "struct addrinfo"
......
...@@ -205,16 +205,9 @@ int ff_getnameinfo(const struct sockaddr *sa, int salen, ...@@ -205,16 +205,9 @@ int ff_getnameinfo(const struct sockaddr *sa, int salen,
} }
if (serv && servlen > 0) { if (serv && servlen > 0) {
struct servent *ent = NULL;
#if HAVE_GETSERVBYPORT
if (!(flags & NI_NUMERICSERV)) if (!(flags & NI_NUMERICSERV))
ent = getservbyport(sin->sin_port, flags & NI_DGRAM ? "udp" : "tcp"); return EAI_FAIL;
#endif /* HAVE_GETSERVBYPORT */ snprintf(serv, servlen, "%d", ntohs(sin->sin_port));
if (ent)
snprintf(serv, servlen, "%s", ent->s_name);
else
snprintf(serv, servlen, "%d", ntohs(sin->sin_port));
} }
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment