summaryrefslogtreecommitdiff
path: root/libavformat/os_support.c
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2012-10-14 20:24:51 +0100
committerMans Rullgard <mans@mansr.com>2012-10-23 12:00:21 +0100
commitc3e73100af9b685be796bcd3e68786130d45ea24 (patch)
tree54b7d357df7d67f8de47d8ba5ff1e31110622c2e /libavformat/os_support.c
parentda0d0ae9a4294fcc42b7159b902c8950ad1abb54 (diff)
network: use getservbyport() only if available
The absence of this function will only give a less informative string back from our fallback implementation of getnameinfo(). Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavformat/os_support.c')
-rw-r--r--libavformat/os_support.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/os_support.c b/libavformat/os_support.c
index 7618708283..451801ff70 100644
--- a/libavformat/os_support.c
+++ b/libavformat/os_support.c
@@ -235,8 +235,10 @@ int ff_getnameinfo(const struct sockaddr *sa, int salen,
if (serv && servlen > 0) {
struct servent *ent = NULL;
+#if HAVE_GETSERVBYPORT
if (!(flags & NI_NUMERICSERV))
ent = getservbyport(sin->sin_port, flags & NI_DGRAM ? "udp" : "tcp");
+#endif
if (ent)
snprintf(serv, servlen, "%s", ent->s_name);