When not specifying a PID with --pid, `chrt` would report: chrt: invalid PID argument: '--pid' That was silly. After this change, `chrt --pid` will report: chrt: too few arguments CC: Madadi Vineeth Reddy <vineethr@xxxxxxxxxxxxx> Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxx> --- schedutils/chrt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/schedutils/chrt.c b/schedutils/chrt.c index 4c45eae80..8ed4d69f3 100644 --- a/schedutils/chrt.c +++ b/schedutils/chrt.c @@ -474,6 +474,8 @@ int main(int argc, char **argv) policy_given = true; break; case 'p': + if (argc - optind == 0) + errx(EXIT_FAILURE, _("too few arguments")); errno = 0; /* strtopid_or_err() is not suitable here; 0 can be passed.*/ ctl->pid = strtos32_or_err(argv[argc - 1], _("invalid PID argument")); -- Dobjátok a Dunába a kis diktátort. 2.48.1