]> git.ipfire.org Git - thirdparty/util-linux.git/commit
chrt: Allow optional priority for non‑prio policies without --pid master
authorMadadi Vineeth Reddy <vineethr@linux.ibm.com>
Tue, 29 Jul 2025 09:47:03 +0000 (15:17 +0530)
committerKarel Zak <kzak@redhat.com>
Tue, 29 Jul 2025 12:31:32 +0000 (14:31 +0200)
commit4c425142844d045b4f898e84c8f29293265214c0
tree5760d1ed26df3eb93c425289e8facacea519a19f
parentf9ec1e1c44bed3456642710b818ba47848db7fff
chrt: Allow optional priority for non‑prio policies without --pid

This extends commit e7a2d62434c2
("chrt: Make priority optional for policies that don't use it")
so that priority arguments are optional even when --pid is not specified.

Before this patch:
$ chrt --other ls -lh
chrt: invalid priority argument: 'ls'
-> only "chrt --other 0 ls -lh" would work

After this patch:
$ chrt --other ls -lh
$ chrt --other 0 ls -lh
-> both now work

If an out‑of‑range priority is given, it reports an error:
$ chrt --other 1 ls -lh
unsupported priority value for the policy: 1 (see --max for valid range)

Changes in v2:
- Removed is_number() and used isdigit_string() (Karel Zak)
- used _() for translation (Karel Zak)

Fixes: e7a2d62434c2 ("chrt: Make priority optional for policies that don't use it")
Signed-off-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
schedutils/chrt.c