]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Improve logging of errors
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 15 May 2017 14:02:23 +0000 (15:02 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 20 May 2017 11:28:22 +0000 (12:28 +0100)
src/libutil/addr.c

index 7a5c73783ac0538d8ede60dade68a43dd7a1b66a..54988cf49bc0bd0b62307ddde6d7aba7073bab55 100644 (file)
@@ -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;
                }