src/ioset.c (ioset_connect): Include the error string when getaddrinfo()
fails.
src/mail-smtp.c (smtp_fill_name): Use gai_strerror() rather than strerror().
hints.ai_family = local ? local->sa_family : 0;
hints.ai_socktype = SOCK_STREAM;
snprintf(portnum, sizeof(portnum), "%u", port);
hints.ai_family = local ? local->sa_family : 0;
hints.ai_socktype = SOCK_STREAM;
snprintf(portnum, sizeof(portnum), "%u", port);
- if (getaddrinfo(peer, portnum, &hints, &ai)) {
- log_module(MAIN_LOG, LOG_ERROR, "getaddrinfo(%s, %s) failed.", peer, portnum);
+ res = getaddrinfo(peer, portnum, &hints, &ai);
+ if (res != 0) {
+ log_module(MAIN_LOG, LOG_ERROR, "getaddrinfo(%s, %s) failed: %s.", peer, portnum, gai_strerror(res));
}
res = getnameinfo(sa, sa_len, namebuf, buflen, NULL, 0, NI_NUMERICHOST);
if (res != 0) {
}
res = getnameinfo(sa, sa_len, namebuf, buflen, NULL, 0, NI_NUMERICHOST);
if (res != 0) {
- log_module(MAIL_LOG, LOG_ERROR, "Unable to get text form of socket name: %s", strerror(errno));
+ log_module(MAIL_LOG, LOG_ERROR, "Unable to get text form of socket name: %s", gai_strerror(res));