&error,
&m,
&info);
- if (r < 0)
+ if (r < 0) {
+ if (bus_error_is_unknown_service(&error))
+ return log_error_errno(r,
+ "Command requires systemd-timesyncd.service, but it is not available: %s",
+ bus_error_message(&error, r));
+
return log_error_errno(r, "Failed to query server: %s", bus_error_message(&error, r));
+ }
if (arg_monitor && !terminal_is_dumb())
fputs(ANSI_HOME_CLEAR, stdout);
}
static int show_timesync(int argc, char **argv, void *userdata) {
+ _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
sd_bus *bus = ASSERT_PTR(userdata);
int r;
print_timesync_property,
arg_property,
arg_print_flags,
- NULL);
- if (r < 0)
+ &error);
+ if (r < 0) {
+ if (bus_error_is_unknown_service(&error))
+ return log_error_errno(r,
+ "Command requires systemd-timesyncd.service, but it is not available: %s",
+ bus_error_message(&error, r));
+
return bus_log_parse_error(r);
+ }
return 0;
}