mirror of
https://github.com/systemd/systemd.git
synced 2024-11-06 08:26:52 +03:00
timedate: use BUS_DEFINE_PROPERTY_GET* macros
This commit is contained in:
parent
62cf085143
commit
6cc379b573
@ -427,6 +427,9 @@ static int unit_enable_or_disable(UnitStatusInfo *u, sd_bus *bus, sd_bus_error *
|
|||||||
return 0;
|
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(
|
static int property_get_rtc_time(
|
||||||
sd_bus *bus,
|
sd_bus *bus,
|
||||||
const char *path,
|
const char *path,
|
||||||
@ -456,30 +459,6 @@ static int property_get_rtc_time(
|
|||||||
return sd_bus_message_append(reply, "t", t);
|
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(
|
static int property_get_can_ntp(
|
||||||
sd_bus *bus,
|
sd_bus *bus,
|
||||||
const char *path,
|
const char *path,
|
||||||
|
Loading…
Reference in New Issue
Block a user