chiark / gitweb /
login: add new call sd_get_machine_names() to get a list of current virtual machines...
[elogind.git] / src / login / logind-dbus.c
index 228a8389ee06b410400872e518e992e23577a58a..68e499f52c1fb9f9aff406cafcbd1d9db330f6b7 100644 (file)
@@ -922,7 +922,7 @@ finish:
 
 static int attach_device(Manager *m, const char *seat, const char *sysfs) {
         struct udev_device *d;
-        char _cleanup_free_ *rule = NULL, *file = NULL;
+        _cleanup_free_ char *rule = NULL, *file = NULL;
         const char *id_for_seat;
         int r;
 
@@ -971,7 +971,7 @@ finish:
 }
 
 static int flush_devices(Manager *m) {
-        DIR _cleanup_closedir_ *d;
+        _cleanup_closedir_ DIR *d;
 
         assert(m);
 
@@ -1137,7 +1137,7 @@ static int bus_manager_can_shutdown_or_sleep(
                 DBusMessage **_reply) {
 
         bool multiple_sessions, challenge, blocked, b;
-        const char *result;
+        const char *result = NULL;
         _cleanup_dbus_message_unref_ DBusMessage *reply = NULL;
         int r;
         unsigned long ul;
@@ -2400,7 +2400,6 @@ DBusHandlerResult bus_message_filter(
                         log_error("Failed to parse JobRemoved message: %s", bus_error_message(&error));
 
                 else if (m->action_job && streq(m->action_job, path)) {
-
                         log_info("Operation finished.");
 
                         /* Tell people that they now may take a lock again */
@@ -2441,7 +2440,7 @@ int manager_dispatch_delayed(Manager *manager) {
 
         assert(manager);
 
-        if (!manager->action_unit || manager->action_job)
+        if (manager->action_what == 0 || manager->action_job)
                 return 0;
 
         /* Continue delay? */
@@ -2457,7 +2456,7 @@ int manager_dispatch_delayed(Manager *manager) {
         dbus_error_init(&error);
         r = execute_shutdown_or_sleep(manager, manager->action_what, manager->action_unit, &error);
         if (r < 0) {
-                log_warning("Failed to send delayed message: %s", bus_error_message_or_strerror(&error, -r));
+                log_warning("Failed to send delayed message: %s", bus_error(&error, r));
                 dbus_error_free(&error);
 
                 manager->action_unit = NULL;