chiark / gitweb /
shared: add formats-util.h
[elogind.git] / src / login / inhibit.c
index 44bda34aff5654b63e36c01fa4c2b8490bc80da3..1f78e4b883d565179a354da6ffe19196e6fd403e 100644 (file)
@@ -20,7 +20,6 @@
 ***/
 
 #include <getopt.h>
-#include <assert.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
@@ -32,6 +31,7 @@
 #include "util.h"
 #include "build.h"
 #include "strv.h"
+#include "formats-util.h"
 
 static const char* arg_what = "idle:sleep:shutdown";
 static const char* arg_who = NULL;
@@ -260,7 +260,7 @@ int main(int argc, char *argv[]) {
 
                 fd = inhibit(bus, &error);
                 if (fd < 0) {
-                        log_error("Failed to inhibit: %s", bus_error_message(&error, -r));
+                        log_error("Failed to inhibit: %s", bus_error_message(&error, fd));
                         return EXIT_FAILURE;
                 }