aboutsummaryrefslogtreecommitdiff
path: root/nss/nss_files
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-01-24 12:08:37 +0000
committerUlrich Drepper <drepper@redhat.com>1998-01-24 12:08:37 +0000
commitecb9d3e182343fb4a89e4446e41037c6971b1657 (patch)
tree257cff3ee3b08e2f3ff6070d7873f5fdedd922c3 /nss/nss_files
parent2f954871a4e32c3a26649e3223cd169367ece097 (diff)
downloadglibc-ecb9d3e182343fb4a89e4446e41037c6971b1657.tar
glibc-ecb9d3e182343fb4a89e4446e41037c6971b1657.tar.gz
glibc-ecb9d3e182343fb4a89e4446e41037c6971b1657.tar.bz2
glibc-ecb9d3e182343fb4a89e4446e41037c6971b1657.zip
Update.
1998-01-24 Ulrich Drepper <drepper@cygnus.com> * sysdeps/unix/sysv/linux/net/if.h (ifr_bandwidth, ifr_qlen): Added to follow latest kernel development. 1998-01-24 15:13 Ulrich Drepper <drepper@happy.cygnus.com>
Diffstat (limited to 'nss/nss_files')
-rw-r--r--nss/nss_files/files-service.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/nss/nss_files/files-service.c b/nss/nss_files/files-service.c
index 186b8a27fc..b63fafcd1e 100644
--- a/nss/nss_files/files-service.c
+++ b/nss/nss_files/files-service.c
@@ -1,5 +1,5 @@
/* Services file parser in nss_files module.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -39,8 +39,8 @@ LINE_PARSER
#include GENERIC
-DB_LOOKUP (servbyname, 2 + strlen (name) + strlen (proto),
- (".%s/%s", name, proto),
+DB_LOOKUP (servbyname, 2 + strlen (name) + (proto ? strlen (proto) : 0),
+ (".%s/%s", name, proto ?: ""),
{
/* Must match both protocol (if specified) and name. */
if (proto != NULL && strcmp (result->s_proto, proto))
@@ -49,10 +49,12 @@ DB_LOOKUP (servbyname, 2 + strlen (name) + strlen (proto),
},
const char *name, const char *proto)
-DB_LOOKUP (servbyport, 21 + strlen (proto), ("=%d/%s", port, proto),
+DB_LOOKUP (servbyport, 21 + (proto ? strlen (proto) : 0),
+ ("=%d/%s", ntohs (port), proto ?: ""),
{
/* Must match both port and protocol. */
- if (result->s_port == port
- && strcmp (result->s_proto, proto) == 0)
+ if (result->s_port == ntohs (port)
+ && (proto == NULL
+ || strcmp (result->s_proto, proto) == 0))
break;
}, int port, const char *proto)