From: Benno Schulenberg Date: Thu, 3 Jul 2025 14:47:49 +0000 (+0200) Subject: chrt: with more than one argument, interpret first argument as priority X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e3da3b885e3176fc56c74b3935124df8cf2ecad5;p=thirdparty%2Futil-linux.git chrt: with more than one argument, interpret first argument as priority The first argument is a priority not only for `chrt --pid ` but also for `chrt [...]`. This fixes an oversight in recent commit e7a2d62434. Reviewed-by: Madadi Vineeth Reddy Tested-by: Madadi Vineeth Reddy Signed-off-by: Benno Schulenberg --- diff --git a/schedutils/chrt.c b/schedutils/chrt.c index 550cefe4d..415a9aa77 100644 --- a/schedutils/chrt.c +++ b/schedutils/chrt.c @@ -530,7 +530,7 @@ int main(int argc, char **argv) errno = 0; - if (need_prio || argc - optind == 2) + if (need_prio || argc - optind > 1) ctl->priority = strtos32_or_err(argv[optind], _("invalid priority argument")); else ctl->priority = 0;