chiark / gitweb /
treewide: no need to negate errno for log_*_errno()
[elogind.git] / src / login / inhibit.c
index 122c69d7a109527992feda7f91b4308458a4053a..db977ccc59b133ed87117b5ec9060e1e3e306df6 100644 (file)
@@ -208,7 +208,7 @@ static int parse_argv(int argc, char *argv[]) {
                         assert_not_reached("Unhandled option");
                 }
 
-        if (arg_action == ACTION_INHIBIT && argc == 1)
+        if (arg_action == ACTION_INHIBIT && optind == argc)
                 arg_action = ACTION_LIST;
 
         else if (arg_action == ACTION_INHIBIT && optind >= argc) {
@@ -235,7 +235,7 @@ int main(int argc, char *argv[]) {
 
         r = sd_bus_default_system(&bus);
         if (r < 0) {
-                log_error("Failed to connect to bus: %s", strerror(-r));
+                log_error_errno(r, "Failed to connect to bus: %m");
                 return EXIT_FAILURE;
         }