From 81a867407659fae007ac4ca95e5685c1d38fa5f1 Mon Sep 17 00:00:00 2001 From: Peter Tribble Date: Sun, 19 Aug 2018 19:39:02 +0100 Subject: 9757 getent ipnodes has wrong exit status Reviewed by: Toomas Soome Reviewed by: Andrew Stormont Reviewed by: Gergő Mihály Doma Approved by: Dan McDonald MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- usr/src/cmd/getent/dogetipnodes.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'usr/src/cmd/getent') 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 -- cgit v1.2.3