From 8f633248e0a20225f46abb0a5ad502a077f1a7e6 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 15 May 2017 15:02:23 +0100 Subject: [PATCH] [Minor] Improve logging of errors --- src/libutil/addr.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/libutil/addr.c b/src/libutil/addr.c index 7a5c73783..54988cf49 100644 --- a/src/libutil/addr.c +++ b/src/libutil/addr.c @@ -974,8 +974,9 @@ rspamd_inet_address_connect (const rspamd_inet_addr_t *addr, gint type, if (r == -1) { if (!async || errno != EINPROGRESS) { close (fd); - msg_warn ("connect failed: %d, '%s'", errno, - strerror (errno)); + msg_warn ("connect %s failed: %d, '%s'", + rspamd_inet_address_to_string_pretty (addr), + errno, strerror (errno)); return -1; } } @@ -1031,8 +1032,10 @@ rspamd_inet_address_listen (const rspamd_inet_addr_t *addr, gint type, if (r == -1) { if (!async || errno != EINPROGRESS) { close (fd); - msg_warn ("bind failed: %d, '%s'", errno, - strerror (errno)); + msg_warn ("bind %s failed: %d, '%s'", + rspamd_inet_address_to_string_pretty (addr), + errno, + strerror (errno)); return -1; } } @@ -1059,7 +1062,9 @@ rspamd_inet_address_listen (const rspamd_inet_addr_t *addr, gint type, r = listen (fd, -1); if (r == -1) { - msg_warn ("listen failed: %d, '%s'", errno, strerror (errno)); + msg_warn ("listen %s failed: %d, '%s'", + rspamd_inet_address_to_string_pretty (addr), + errno, strerror (errno)); close (fd); return -1; } -- 2.39.5