Earlier message:
$ chrt -i 1 ls
chrt: failed to set pid 0's policy: Invalid argument
basically told 'something failed', while the new one tries to be more
helpful.
$ chrt -i 1 ls
chrt: unsupported priority value for the policy: 1: see --max for valid range
Addresses: https://bugs.debian.org/791707
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
#endif
if (ctl->pid == -1)
ctl->pid = 0;
-
+ if (ctl->priority < sched_get_priority_min(ctl->policy) ||
+ sched_get_priority_max(ctl->policy) < ctl->priority)
+ errx(EXIT_FAILURE,
+ _("unsupported priority value for the policy: %d: see --max for valid range"),
+ ctl->priority);
set_sched(ctl);
if (ctl->verbose)