]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
chrt: allow option separator
authorThomas Weißschuh <thomas@t-8ch.de>
Wed, 26 Jul 2023 14:33:09 +0000 (16:33 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Wed, 26 Jul 2023 16:37:28 +0000 (18:37 +0200)
Allow the option separator "--".
It works in other, similar tools like nice and ionice.

Example:

chrt 1 -- id

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
schedutils/chrt.c

index 250d878063b6d8b6e2d5821fb1eeb09dda5983a6..eedb9d83bf5ed5c7ba7934b7ebff65e8dc7d5147 100644 (file)
@@ -485,6 +485,8 @@ int main(int argc, char **argv)
 
        if (!ctl->pid) {
                argv += optind + 1;
+               if (strcmp(argv[0], "--") == 0)
+                       argv++;
                execvp(argv[0], argv);
                errexec(argv[0]);
        }