summaryrefslogtreecommitdiff
path: root/src/timedate
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-09-11 17:18:14 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-09-12 12:11:25 +0900
commiteda193578effbc3cee0f6d56ade52434778737c9 (patch)
treeca73e40f8e75ccc05fda43e39d6b168bdc0eaca3 /src/timedate
parent878f2dae77e61ee6765b72318f49f8226f45ec0f (diff)
downloadsystemd-eda193578effbc3cee0f6d56ade52434778737c9.tar.gz
bus-util: make --property= optionally take value
Diffstat (limited to 'src/timedate')
-rw-r--r--src/timedate/timedatectl.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c
index 6ed8934a46..156a6aae6a 100644
--- a/src/timedate/timedatectl.c
+++ b/src/timedate/timedatectl.c
@@ -589,15 +589,7 @@ static int show_timesync_status(int argc, char **argv, void *userdata) {
return 0;
}
-#define property(name, fmt, ...) \
- do { \
- if (value) \
- printf(fmt "\n", __VA_ARGS__); \
- else \
- printf("%s=" fmt "\n", name, __VA_ARGS__); \
- } while (0)
-
-static int print_timesync_property(const char *name, sd_bus_message *m, bool value, bool all) {
+static int print_timesync_property(const char *name, const char *expected_value, sd_bus_message *m, bool value, bool all) {
char type;
const char *contents;
int r;
@@ -663,7 +655,7 @@ static int print_timesync_property(const char *name, sd_bus_message *m, bool val
return r;
if (arg_all || !isempty(str))
- property(name, "%s", str);
+ bus_print_property_value(name, expected_value, value, "%s", str);
return 1;
}