From 584ddd64e2f0caa3673bb219407e084826f5d965 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Tue, 13 Sep 2016 23:49:09 +0100 Subject: Logging: fix errno decodes --- src/src/log.c | 2 +- src/src/transports/smtp.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/src/log.c b/src/src/log.c index 860b8b0a2..032eb876f 100644 --- a/src/src/log.c +++ b/src/src/log.c @@ -117,7 +117,7 @@ static const uschar * exim_errstrings[] = { const uschar * exim_errstr(int err) { -return errno < 0 ? exim_errstrings[-err] : CUS strerror(err); +return err < 0 ? exim_errstrings[-err] : CUS strerror(err); } /************************************************* diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c index 85582e753..e8a675750 100644 --- a/src/src/transports/smtp.c +++ b/src/src/transports/smtp.c @@ -631,11 +631,11 @@ Returns: nothing static void write_logs(address_item *addr, host_item *host) { -uschar * message = string_sprintf("H=%s [%s]", host->name, host->address); +uschar * message = LOGGING(outgoing_port) + ? string_sprintf("H=%s [%s]:%d", host->name, host->address, + host->port == PORT_NONE ? 25 : host->port) + : string_sprintf("H=%s [%s]", host->name, host->address); -if (LOGGING(outgoing_port)) - message = string_sprintf("%s:%d", message, - host->port == PORT_NONE ? 25 : host->port); if (addr->message) { message = string_sprintf("%s: %s", message, addr->message); -- cgit v1.2.3