diff options
-rw-r--r-- | src/libsystemd/sd-bus/bus-message.c | 6 | ||||
-rw-r--r-- | src/login/logind-core.c | 2 | ||||
-rw-r--r-- | src/login/logind-dbus.c | 21 | ||||
-rw-r--r-- | src/login/logind-inhibit.c | 2 | ||||
-rw-r--r-- | src/login/logind-seat.c | 2 | ||||
-rw-r--r-- | src/login/logind-session-dbus.c | 2 | ||||
-rw-r--r-- | src/login/logind-user-dbus.c | 2 | ||||
-rw-r--r-- | src/login/logind-user.c | 2 | ||||
-rw-r--r-- | src/systemctl/systemctl.c | 2 |
9 files changed, 30 insertions, 11 deletions
diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c index c38b2a5fa5..983e2f62cd 100644 --- a/src/libsystemd/sd-bus/bus-message.c +++ b/src/libsystemd/sd-bus/bus-message.c @@ -803,7 +803,7 @@ _public_ int sd_bus_message_new_method_errorf( const char *format, ...) { - _cleanup_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; va_list ap; assert_return(name, -EINVAL); @@ -822,7 +822,7 @@ _public_ int sd_bus_message_new_method_errno( int error, const sd_bus_error *p) { - _cleanup_free_ sd_bus_error berror = SD_BUS_ERROR_NULL; + _cleanup_bus_error_free_ sd_bus_error berror = SD_BUS_ERROR_NULL; if (sd_bus_error_is_set(p)) return sd_bus_message_new_method_error(call, m, p); @@ -839,7 +839,7 @@ _public_ int sd_bus_message_new_method_errnof( const char *format, ...) { - _cleanup_free_ sd_bus_error berror = SD_BUS_ERROR_NULL; + _cleanup_bus_error_free_ sd_bus_error berror = SD_BUS_ERROR_NULL; va_list ap; va_start(ap, format); diff --git a/src/login/logind-core.c b/src/login/logind-core.c index 440c32aa2c..f9e6ddfb3f 100644 --- a/src/login/logind-core.c +++ b/src/login/logind-core.c @@ -360,7 +360,7 @@ int manager_get_user_by_pid(Manager *m, pid_t pid, User **user) { int manager_get_idle_hint(Manager *m, dual_timestamp *t) { Session *s; bool idle_hint; - dual_timestamp ts = { 0, 0 }; + dual_timestamp ts = DUAL_TIMESTAMP_NULL; Iterator i; assert(m); diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index b272401e5b..e6f9ec7845 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -158,7 +158,7 @@ static int property_get_idle_since_hint( sd_bus_error *error) { Manager *m = userdata; - dual_timestamp t; + dual_timestamp t = DUAL_TIMESTAMP_NULL; assert(bus); assert(reply); @@ -243,6 +243,24 @@ static int property_get_scheduled_shutdown( static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_handle_action, handle_action, HandleAction); +static int property_get_docked( + sd_bus *bus, + const char *path, + const char *interface, + const char *property, + sd_bus_message *reply, + void *userdata, + sd_bus_error *error) { + + Manager *m = userdata; + + assert(bus); + assert(reply); + assert(m); + + return sd_bus_message_append(reply, "b", manager_is_docked_or_multiple_displays(m)); +} + static int method_get_session(sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_free_ char *p = NULL; Manager *m = userdata; @@ -2406,6 +2424,7 @@ const sd_bus_vtable manager_vtable[] = { SD_BUS_PROPERTY("PreparingForShutdown", "b", property_get_preparing, 0, 0), SD_BUS_PROPERTY("PreparingForSleep", "b", property_get_preparing, 0, 0), SD_BUS_PROPERTY("ScheduledShutdown", "(st)", property_get_scheduled_shutdown, 0, 0), + SD_BUS_PROPERTY("Docked", "b", property_get_docked, 0, 0), SD_BUS_METHOD("GetSession", "s", "o", method_get_session, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("GetSessionByPID", "u", "o", method_get_session_by_pid, SD_BUS_VTABLE_UNPRIVILEGED), diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c index 68304a1610..855c85402c 100644 --- a/src/login/logind-inhibit.c +++ b/src/login/logind-inhibit.c @@ -371,7 +371,7 @@ bool manager_is_inhibited( Inhibitor *i; Iterator j; - struct dual_timestamp ts = { 0, 0 }; + struct dual_timestamp ts = DUAL_TIMESTAMP_NULL; bool inhibited = false; assert(m); diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c index 11d24ce5b4..3c30eeaa95 100644 --- a/src/login/logind-seat.c +++ b/src/login/logind-seat.c @@ -599,7 +599,7 @@ bool seat_can_graphical(Seat *s) { int seat_get_idle_hint(Seat *s, dual_timestamp *t) { Session *session; bool idle_hint = true; - dual_timestamp ts = { 0, 0 }; + dual_timestamp ts = DUAL_TIMESTAMP_NULL; assert(s); diff --git a/src/login/logind-session-dbus.c b/src/login/logind-session-dbus.c index debaa31a29..563153e2d9 100644 --- a/src/login/logind-session-dbus.c +++ b/src/login/logind-session-dbus.c @@ -163,7 +163,7 @@ static int property_get_idle_since_hint( sd_bus_error *error) { Session *s = userdata; - dual_timestamp t; + dual_timestamp t = DUAL_TIMESTAMP_NULL; uint64_t u; int r; diff --git a/src/login/logind-user-dbus.c b/src/login/logind-user-dbus.c index 8a710cef13..0f72d70b10 100644 --- a/src/login/logind-user-dbus.c +++ b/src/login/logind-user-dbus.c @@ -138,7 +138,7 @@ static int property_get_idle_since_hint( sd_bus_error *error) { User *u = userdata; - dual_timestamp t; + dual_timestamp t = DUAL_TIMESTAMP_NULL; uint64_t k; assert(bus); diff --git a/src/login/logind-user.c b/src/login/logind-user.c index a9cf529e12..6720899def 100644 --- a/src/login/logind-user.c +++ b/src/login/logind-user.c @@ -619,7 +619,7 @@ int user_finalize(User *u) { int user_get_idle_hint(User *u, dual_timestamp *t) { Session *s; bool idle_hint = true; - dual_timestamp ts = { 0, 0 }; + dual_timestamp ts = DUAL_TIMESTAMP_NULL; assert(u); diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 40bea87dfa..23fc946fbf 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -1183,7 +1183,7 @@ static int list_timers(sd_bus *bus, char **args) { for (u = unit_infos; u < unit_infos + n; u++) { _cleanup_strv_free_ char **triggered = NULL; - dual_timestamp next = {}; + dual_timestamp next = DUAL_TIMESTAMP_NULL; usec_t m, last = 0; if (!endswith(u->id, ".timer")) |