summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-05-24 22:22:21 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-06-04 17:03:36 +0900
commit17087340c3ad0f948033da3f07e4ff97af9bdd27 (patch)
tree1a2c2ea9905bdd48f06ebcd0112cee38a55a62e7 /src/journal
parent3681d639353dbb5b976252f14b5ba42624c4562d (diff)
downloadsystemd-17087340c3ad0f948033da3f07e4ff97af9bdd27.tar.gz
systemd-17087340c3ad0f948033da3f07e4ff97af9bdd27.tar.bz2
systemd-17087340c3ad0f948033da3f07e4ff97af9bdd27.zip
journalctl: fix error cause in log message
If varlink_call() returns negative errno, then `error` is null.
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journalctl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 91a21e407f..7d5b115c71 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;
}