[systemd-devel] [PATCH] inhibit: fix early exit when listing inhibitors

Jonathan Conder jonno.conder at gmail.com
Sat Sep 1 04:39:47 PDT 2012


This should be fairly self-explanatory, I hope. Without this, systemd-inhibit --list outputs nothing; with it, there are at least some column headings and a count of the number of inhibitors.

Signed-off-by: Jonathan Conder <jonno.conder at gmail.com>
---
 src/login/inhibit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/login/inhibit.c b/src/login/inhibit.c
index 029c954..d4c697b 100644
--- a/src/login/inhibit.c
+++ b/src/login/inhibit.c
@@ -86,9 +86,10 @@ static int print_inhibitors(DBusConnection *bus, DBusError *error) {
                         &reply,
                         NULL,
                         DBUS_TYPE_INVALID);
-        if (r)
+        if (r) {
                 return -ENOMEM;
                 goto finish;
+	}
 
         if (!dbus_message_iter_init(reply, &iter)) {
                 r = -ENOMEM;
-- 
1.7.12


More information about the systemd-devel mailing list