bp = buf;
if ((gairesult = getnameinfo(&remote.addr, rlen, host, sizeof host, NULL,
0, NI_NUMERICHOST | NI_NUMERICSERV)) != 0) {
- safe_str("Error: getnameinfo(remote): ", buf, &bp);
- if (gairesult == EAI_SYSTEM) {
- safe_integer(errno, buf, &bp);
- safe_chr('/', buf, &bp);
- safe_str(strerror(errno), buf, &bp);
- } else {
- safe_integer(gairesult, buf, &bp);
- safe_chr('/', buf, &bp);
- safe_str(gai_strerror(gairesult), buf, &bp);
- }
+ if (gairesult == EAI_SYSTEM)
+ perror("info_slave getnameinfo");
+ else
+ fprintf(stderr, "info_slave getnameinfo: %s\n",
+ gai_strerror(gairesult));
} else {
safe_str(host, buf, &bp);
}
if ((gairesult = getnameinfo(&local.addr, llen, NULL, 0, lport,
sizeof lport,
NI_NUMERICHOST | NI_NUMERICSERV)) != 0) {
- safe_str("Error: getnameinfo(local): ", buf, &bp);
- if (gairesult == EAI_SYSTEM) {
- safe_integer(errno, buf, &bp);
- safe_chr('/', buf, &bp);
- safe_str(strerror(errno), buf, &bp);
- } else {
- safe_integer(gairesult, buf, &bp);
- safe_chr('/', buf, &bp);
- safe_str(gai_strerror(gairesult), buf, &bp);
- }
+ if (gairesult == EAI_SYSTEM)
+ perror("info_slave getnameinfo");
+ else
+ fprintf(stderr, "info_slave getnameinfo: %s\n",
+ gai_strerror(gairesult));
} else {
safe_str(lport, buf, &bp);
}
if (use_dns) {
if ((gairesult = getnameinfo(&remote.addr, rlen, host, sizeof host, NULL,
0, NI_NUMERICSERV) != 0)) {
- safe_str("Error: getnameinfo(local/dns): ", buf, &bp);
- if (gairesult == EAI_SYSTEM) {
- safe_integer(errno, buf, &bp);
- safe_chr('/', buf, &bp);
- safe_str(strerror(errno), buf, &bp);
- } else {
- safe_integer(gairesult, buf, &bp);
- safe_chr('/', buf, &bp);
- safe_str(gai_strerror(gairesult), buf, &bp);
- }
+ if (gairesult == EAI_SYSTEM)
+ perror("info_slave getnameinfo");
+ else
+ fprintf(stderr, "info_slave getnameinfo: %s\n",
+ gai_strerror(gairesult));
} else {
- safe_str(host, buf, &bp);
+ safe_str(host, buf, &bp);
}
} else
safe_str(host, buf, &bp);