1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-26 14:04:03 +03:00

systemctl: show Timers{Monotonic,Calendar}=

This commit is contained in:
Yu Watanabe 2018-02-05 15:27:42 +09:00
parent b9ee05c266
commit fa6dee52ca

View File

@ -4920,7 +4920,7 @@ static int print_property(const char *name, sd_bus_message *m, const char *conte
return 0;
} else if (contents[1] == SD_BUS_TYPE_STRUCT_BEGIN && streq(name, "Timers")) {
} else if (contents[1] == SD_BUS_TYPE_STRUCT_BEGIN && streq(name, "TimersMonotonic")) {
const char *base;
uint64_t value, next_elapse;
@ -4931,7 +4931,7 @@ static int print_property(const char *name, sd_bus_message *m, const char *conte
while ((r = sd_bus_message_read(m, "(stt)", &base, &value, &next_elapse)) > 0) {
char timespan1[FORMAT_TIMESPAN_MAX], timespan2[FORMAT_TIMESPAN_MAX];
print_prop(base, "{ value=%s ; next_elapse=%s }",
print_prop(name, "{ %s=%s ; next_elapse=%s }", base,
format_timespan(timespan1, sizeof(timespan1), value, 0),
format_timespan(timespan2, sizeof(timespan2), next_elapse, 0));
}
@ -4944,6 +4944,29 @@ static int print_property(const char *name, sd_bus_message *m, const char *conte
return 0;
} else if (contents[1] == SD_BUS_TYPE_STRUCT_BEGIN && streq(name, "TimersCalendar")) {
const char *base, *spec;
uint64_t next_elapse;
r = sd_bus_message_enter_container(m, SD_BUS_TYPE_ARRAY, "(sst)");
if (r < 0)
return bus_log_parse_error(r);
while ((r = sd_bus_message_read(m, "(sst)", &base, &spec, &next_elapse)) > 0) {
char timestamp[FORMAT_TIMESTAMP_MAX];
print_prop(name, "{ %s=%s ; next_elapse=%s }", base, spec,
format_timestamp(timestamp, sizeof(timestamp), next_elapse));
}
if (r < 0)
return bus_log_parse_error(r);
r = sd_bus_message_exit_container(m);
if (r < 0)
return bus_log_parse_error(r);
return 0;
} else if (contents[1] == SD_BUS_TYPE_STRUCT_BEGIN && startswith(name, "Exec")) {
ExecStatusInfo info = {};