diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-05-18 20:25:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-18 20:25:52 +0200 |
commit | 0612ac38a72a24627b1948aa388d9cefdfaf212a (patch) | |
tree | 3854e5dc8fa442a0689e0c7943728e798af88490 /src/timedate/timedated.c | |
parent | 627d2bac2477986401400127fb31af33ca0f69b0 (diff) | |
parent | 14f7edb0949c68d0789d6a10e19821a62310544d (diff) | |
download | systemd-0612ac38a72a24627b1948aa388d9cefdfaf212a.tar.gz |
Merge pull request #8985 from yuwata/bus-macro-3
tree-wide: use BUS_DEFINE_PROPERTY_GET* macros
Diffstat (limited to 'src/timedate/timedated.c')
-rw-r--r-- | src/timedate/timedated.c | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c index 1f161d4a4e..e066320cff 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, |