summaryrefslogtreecommitdiff
path: root/src/timedate
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-05-14 10:04:04 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-05-15 23:07:02 +0900
commit6cc379b5738e6ab2f04f115e8171bb85aef92bea (patch)
tree71ed240543a12e6a1ce9eea4b0f55322cdac1334 /src/timedate
parent62cf0851430b4c49fe6b91cfad7de858dda782a2 (diff)
downloadsystemd-6cc379b5738e6ab2f04f115e8171bb85aef92bea.tar.gz
timedate: use BUS_DEFINE_PROPERTY_GET* macros
Diffstat (limited to 'src/timedate')
-rw-r--r--src/timedate/timedated.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
index 6928bb9a97..72243f374a 100644
--- a/src/timedate/timedated.c
+++ b/src/timedate/timedated.c
@@ -427,6 +427,9 @@ static int unit_enable_or_disable(UnitStatusInfo *u, sd_bus *bus, sd_bus_error *
return 0;
}
+static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_time, "t", now(CLOCK_REALTIME));
+static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_ntp_sync, "b", ntp_synced());
+
static int property_get_rtc_time(
sd_bus *bus,
const char *path,
@@ -456,30 +459,6 @@ static int property_get_rtc_time(
return sd_bus_message_append(reply, "t", t);
}
-static int property_get_time(
- sd_bus *bus,
- const char *path,
- const char *interface,
- const char *property,
- sd_bus_message *reply,
- void *userdata,
- sd_bus_error *error) {
-
- return sd_bus_message_append(reply, "t", now(CLOCK_REALTIME));
-}
-
-static int property_get_ntp_sync(
- sd_bus *bus,
- const char *path,
- const char *interface,
- const char *property,
- sd_bus_message *reply,
- void *userdata,
- sd_bus_error *error) {
-
- return sd_bus_message_append(reply, "b", ntp_synced());
-}
-
static int property_get_can_ntp(
sd_bus *bus,
const char *path,