From: Yu Watanabe Date: Fri, 24 May 2019 13:22:21 +0000 (+0900) Subject: journalctl: fix error cause in log message X-Git-Tag: v243-rc1~316^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17087340c3ad0f948033da3f07e4ff97af9bdd27;p=thirdparty%2Fsystemd.git journalctl: fix error cause in log message If varlink_call() returns negative errno, then `error` is null. --- diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 91a21e407fc..7d5b115c71d 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -1955,7 +1955,10 @@ static int simple_varlink_call(const char *option, const char *method) { r = varlink_call(link, method, NULL, NULL, &error, NULL); if (r < 0) - return log_error_errno(r, "Failed to execute varlink call: %s", error); + return log_error_errno(r, "Failed to execute varlink call: %m"); + if (error) + return log_error_errno(SYNTHETIC_ERRNO(ENOANO), + "Failed to execute varlink call: %s", error); return 0; }