From bc29813ae05904051827abcdf0fe5297ca1ead78 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sun, 12 Aug 2007 19:02:51 +0000 Subject: [PATCH] Remove dead code (VLC only uses port numbers, not service names ever) --- src/network/getaddrinfo.c | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/src/network/getaddrinfo.c b/src/network/getaddrinfo.c index b0fb52111c..35c584e9d4 100644 --- a/src/network/getaddrinfo.c +++ b/src/network/getaddrinfo.c @@ -402,34 +402,10 @@ getaddrinfo (const char *node, const char *service, char *end; d = strtoul (service, &end, 0); - if (end[0] /* service is not a number */ - || (d > 65535)) - { - struct servent *entry; - const char *protoname; - - switch (protocol) - { - case IPPROTO_TCP: - protoname = "tcp"; - break; - - case IPPROTO_UDP: - protoname = "udp"; - break; - - default: - protoname = NULL; - } - - entry = getservbyname (service, protoname); - if (entry == NULL) - return EAI_SERVICE; + if (end[0] || (d > 65535u)) + return EAI_SERVICE; - port = entry->s_port; - } - else - port = htons ((u_short)d); + port = htons ((u_short)d); } /* building results... */ -- 2.39.2