Update.
2003-02-14 Thorsten Kukuk <kukuk@suse.de> * nss/getent.c (print_hosts): Print all IP addresses of one host.
This commit is contained in:
parent
0a37669aa5
commit
fdcd8f9c71
|
@ -1,3 +1,7 @@
|
|||
2003-02-14 Thorsten Kukuk <kukuk@suse.de>
|
||||
|
||||
* nss/getent.c (print_hosts): Print all IP addresses of one host.
|
||||
|
||||
2003-02-15 Roland McGrath <roland@frob.com>
|
||||
|
||||
* sysdeps/mach/hurd/tls.h: New file.
|
||||
|
|
27
nss/getent.c
27
nss/getent.c
|
@ -232,21 +232,24 @@ group_keys (int number, char *key[])
|
|||
static inline void
|
||||
print_hosts (struct hostent *host)
|
||||
{
|
||||
unsigned int i;
|
||||
char buf[INET6_ADDRSTRLEN];
|
||||
const char *ip = inet_ntop (host->h_addrtype, host->h_addr_list[0],
|
||||
buf, sizeof (buf));
|
||||
unsigned int cnt;
|
||||
|
||||
printf ("%-15s %s", ip, host->h_name);
|
||||
|
||||
i = 0;
|
||||
while (host->h_aliases[i] != NULL)
|
||||
for (cnt = 0; host->h_addr_list[cnt] != NULL; ++cnt)
|
||||
{
|
||||
putchar_unlocked (' ');
|
||||
fputs_unlocked (host->h_aliases[i], stdout);
|
||||
++i;
|
||||
char buf[INET6_ADDRSTRLEN];
|
||||
const char *ip = inet_ntop (host->h_addrtype, host->h_addr_list[cnt],
|
||||
buf, sizeof (buf));
|
||||
|
||||
printf ("%-15s %s", ip, host->h_name);
|
||||
|
||||
unsigned int i;
|
||||
for (i = 0; host->h_aliases[i] != NULL; ++i)
|
||||
{
|
||||
putchar_unlocked (' ');
|
||||
fputs_unlocked (host->h_aliases[i], stdout);
|
||||
}
|
||||
putchar_unlocked ('\n');
|
||||
}
|
||||
putchar_unlocked ('\n');
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in New Issue