From: Jeremy Harris Date: Tue, 13 Sep 2016 22:49:09 +0000 (+0100) Subject: Logging: fix errno decodes X-Git-Tag: exim-4_88_RC1~8 X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/584ddd64e2f0caa3673bb219407e084826f5d965?ds=inline;hp=d129bdf7868aef9212401b60fa748753535e0f7a Logging: fix errno decodes --- 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);