dumpon: do not print errno for resolver failure
When the netdump host name fails to resolve, don't print errno, since it's irrelevant. We might as well use a different exit status, too. Sponsored by: Dell EMC Isilon
This commit is contained in:
parent
d5be41beb7
commit
576313b983
@ -532,10 +532,11 @@ main(int argc, char *argv[])
|
||||
hints.ai_protocol = IPPROTO_UDP;
|
||||
res = NULL;
|
||||
error = getaddrinfo(server, NULL, &hints, &res);
|
||||
if (error != 0)
|
||||
err(1, "%s", gai_strerror(error));
|
||||
if (res == NULL)
|
||||
errx(1, "failed to resolve '%s'", server);
|
||||
if (error != 0) {
|
||||
if (error == EAI_SYSTEM)
|
||||
err(EX_OSERR, "%s", gai_strerror(error));
|
||||
errx(EX_NOHOST, "%s", gai_strerror(error));
|
||||
}
|
||||
server = inet_ntoa(
|
||||
((struct sockaddr_in *)(void *)res->ai_addr)->sin_addr);
|
||||
freeaddrinfo(res);
|
||||
|
Loading…
x
Reference in New Issue
Block a user