The first argument is a priority not only for `chrt --pid <prio> <pid>`
but also for `chrt <prio> <command> [<argument>...]`.
This fixes an oversight in recent commit
e7a2d62434.
Reviewed-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Tested-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
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;