chiark / gitweb /
Make systemd-inhibit --list work
authorMatthias Clasen <mclasen@redhat.com>
Sat, 8 Sep 2012 02:56:35 +0000 (22:56 -0400)
committerLennart Poettering <lennart@poettering.net>
Mon, 10 Sep 2012 07:32:50 +0000 (09:32 +0200)
The code in the print_inhibitors function had an unintended
unconditional early exit, causing it to never print any
inhibitors.

src/login/inhibit.c

index 029c9549d2ecafb73f7036402afe3610e8c5b384..62a8223e6381a84a8c455fe227b473798a8c823e 100644 (file)
@@ -86,9 +86,10 @@ static int print_inhibitors(DBusConnection *bus, DBusError *error) {
                         &reply,
                         NULL,
                         DBUS_TYPE_INVALID);
                         &reply,
                         NULL,
                         DBUS_TYPE_INVALID);
-        if (r)
-                return -ENOMEM;
+        if (r) {
+                r = -ENOMEM;
                 goto finish;
                 goto finish;
+        }
 
         if (!dbus_message_iter_init(reply, &iter)) {
                 r = -ENOMEM;
 
         if (!dbus_message_iter_init(reply, &iter)) {
                 r = -ENOMEM;