summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/login/inhibit.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/login/inhibit.c b/src/login/inhibit.c
index 586582190e..a812195cae 100644
--- a/src/login/inhibit.c
+++ b/src/login/inhibit.c
@@ -230,7 +230,10 @@ static int parse_argv(int argc, char *argv[]) {
}
}
- if (arg_action == ACTION_INHIBIT && optind >= argc) {
+ if (arg_action == ACTION_INHIBIT && argc == 1)
+ arg_action = ACTION_LIST;
+
+ else if (arg_action == ACTION_INHIBIT && optind >= argc) {
log_error("Missing command line to execute.");
return -EINVAL;
}