From: Benno Schulenberg Date: Tue, 5 Aug 2025 09:24:40 +0000 (+0200) Subject: chrt: produce better error message for missing priority with implied -r X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d15fbc946f73a2b7942d594b3e1cbc2ad89d0554;p=thirdparty%2Futil-linux.git chrt: produce better error message for missing priority with implied -r Since commit 4c425142844d, the following two equivalent commands produce different error messages: # chrt -r ls NEWS chrt: invalid priority argument: 'ls' # chrt ls NEWS chrt: unsupported priority value for the policy: 0: see --max for valid range The latter error message is enigmatic: where did the user specify '0'? Before the mentioned commit, the second command would produce the same error message as the first. Restore that behavior. CC: Madadi Vineeth Reddy Signed-off-by: Benno Schulenberg --- diff --git a/schedutils/chrt.c b/schedutils/chrt.c index 1a9522728..e07284e41 100644 --- a/schedutils/chrt.c +++ b/schedutils/chrt.c @@ -524,6 +524,9 @@ int main(int argc, char **argv) } } + if (ctl->policy == SCHED_RR) + need_prio = true; + if (ctl->verbose) show_sched_info(ctl);