- if (!(h = gethostbyname(host))) {
- error_msg("unknown host %s", host);
- exit(1);
- }
-
- if (h->h_addrtype != AF_INET) {
- error_msg("unknown address type; only AF_INET is currently supported.");
- exit(1);
- }
+ h = xgethostbyname(host);
+ if (h->h_addrtype != AF_INET)
+ error_msg_and_die("unknown address type; only AF_INET is currently supported.");