diff options
author | Peter Tribble <peter.tribble@gmail.com> | 2018-08-19 19:39:02 +0100 |
---|---|---|
committer | Dan McDonald <danmcd@joyent.com> | 2018-08-20 13:36:49 -0400 |
commit | 81a867407659fae007ac4ca95e5685c1d38fa5f1 (patch) | |
tree | 7c72a7da0bbedcd0f3b7a9be1dd3f16360937caa /usr/src/cmd/getent | |
parent | e153cda9f9660e385e8f468253f80e59f5d454d7 (diff) | |
download | illumos-joyent-81a867407659fae007ac4ca95e5685c1d38fa5f1.tar.gz |
9757 getent ipnodes has wrong exit status
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Reviewed by: Gergő Mihály Doma <domag02@gmail.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/cmd/getent')
-rw-r--r-- | usr/src/cmd/getent/dogetipnodes.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/usr/src/cmd/getent/dogetipnodes.c b/usr/src/cmd/getent/dogetipnodes.c index 5196889870..a07852027a 100644 --- a/usr/src/cmd/getent/dogetipnodes.c +++ b/usr/src/cmd/getent/dogetipnodes.c @@ -19,9 +19,9 @@ * * CDDL HEADER END */ -#ident "%Z%%M% %I% %E% SMI" /* + * Copyright (c) 2018 Peter Tribble. * Copyright (c) 1994-1999, by Sun Microsystems, Inc. */ @@ -56,7 +56,7 @@ puthostent(const struct hostent *hp, FILE *fp) if (hp->h_addrtype == AF_INET6) { if (IN6_IS_ADDR_V4MAPPED((struct in6_addr *)*p)) { IN6_V4MAPPED_TO_INADDR((struct in6_addr *)*p, - &in4); + &in4); af = AF_INET; addr = &in4; } else { @@ -99,8 +99,7 @@ dogetipnodes(const char **list) int err_ret; if (list == NULL || *list == NULL) { - (void) fprintf(stdout, - "Enumeration not supported on ipnodes\n"); + rc = EXC_ENUM_NOT_SUPPORTED; } else { for (; *list != NULL; list++) { if (strchr(*list, ':') != 0) { @@ -115,11 +114,8 @@ dogetipnodes(const char **list) if (inet_pton(af, *list, addr) == 1) hp = getipnodebyaddr(addr, len, af, &err_ret); else - hp = getipnodebyname( - *list, - AF_INET6, - AI_V4MAPPED|AI_ALL, - &err_ret); + hp = getipnodebyname(*list, AF_INET6, + AI_V4MAPPED|AI_ALL, &err_ret); if (hp == NULL) rc = EXC_NAME_NOT_FOUND; else |