summaryrefslogtreecommitdiff
path: root/src/systemctl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-07-04 04:37:03 +0200
committerLennart Poettering <lennart@poettering.net>2010-07-04 04:37:03 +0200
commit707e5e52804a8f041f0d2f822f0bcf7062ad24ac (patch)
tree41513704c8e77e5116f20e802254b409fe87cd27 /src/systemctl.c
parente87d1818cdf26b8d946776a2182e4ef2847bc0aa (diff)
dbus: complete coverage of timer units
Diffstat (limited to 'src/systemctl.c')
-rw-r--r--src/systemctl.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/systemctl.c b/src/systemctl.c
index 4620315a02..dddd689332 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -1024,7 +1024,7 @@ static int print_property(const char *name, DBusMessageIter *iter) {
/* Yes, heuristics! But we can change this check
* should it turn out to not be sufficient */
- if (strstr(name, "Timestamp")) {
+ if (strstr(name, "Timestamp") || strstr(name, "Elapse")) {
char timestamp[FORMAT_TIMESTAMP_MAX], *t;
if ((t = format_timestamp(timestamp, sizeof(timestamp), u)) || arg_all)
@@ -1130,6 +1130,26 @@ static int print_property(const char *name, DBusMessageIter *iter) {
}
return 0;
+ } else if (dbus_message_iter_get_element_type(iter) == DBUS_TYPE_STRUCT && streq(name, "Timers")) {
+ DBusMessageIter sub, sub2;
+
+ dbus_message_iter_recurse(iter, &sub);
+
+ while (dbus_message_iter_get_arg_type(&sub) == DBUS_TYPE_STRUCT) {
+ const char *base;
+ uint64_t value, next_elapse;
+
+ dbus_message_iter_recurse(&sub, &sub2);
+
+ if (bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &base, true) >= 0 &&
+ bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_UINT64, &value, true) >= 0 &&
+ bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_UINT64, &next_elapse, false) >= 0)
+ printf("%s=%llu\n", base, (unsigned long long) value);
+
+ dbus_message_iter_next(&sub);
+ }
+
+ return 0;
}
break;