]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journalctl: fix error cause in log message
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 24 May 2019 13:22:21 +0000 (22:22 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 4 Jun 2019 08:03:36 +0000 (17:03 +0900)
If varlink_call() returns negative errno, then `error` is null.

src/journal/journalctl.c

index 91a21e407fcedab0595da0719d13b975c35c1468..7d5b115c71d081cbe6fa81c210fe8700e65d4496 100644 (file)
@@ -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;
 }