journalctl: fix error cause in log message

If varlink_call() returns negative errno, then `error` is null.
This commit is contained in:
Yu Watanabe
2019-06-04 17:03:36 +09:00
parent 3681d63935
commit 17087340c3
+4 -1
View 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;
}