]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
uclampset: Fix left over optind++
authorQais Yousef <qais.yousef@arm.com>
Mon, 7 Jun 2021 16:11:11 +0000 (17:11 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 8 Jun 2021 13:56:00 +0000 (15:56 +0200)
The code was changed to use ':' in getopt_long() but these were left
over by mistake causing weird random errors when using these options
depending on the order they were fed.

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
schedutils/uclampset.c

index 444e350f41bc5c69bce55da2588794409e3c56af..e09d6a7f9f0e2bca09c8d746f26331a7c19704a8 100644 (file)
@@ -253,7 +253,6 @@ int main(int argc, char **argv)
                case 'p':
                        errno = 0;
                        ctl->pid = strtos32_or_err(optarg, _("invalid PID argument"));
-                       optind++;
                        break;
                case 's':
                        ctl->system = 1;
@@ -268,13 +267,11 @@ int main(int argc, char **argv)
                        ctl->util_min = strtos32_or_err(optarg, _("invalid util_min argument"));
                        ctl->util_min_set = 1;
                        validate_util(ctl->util_min);
-                       optind++;
                        break;
                case 'M':
                        ctl->util_max = strtos32_or_err(optarg, _("invalid util_max argument"));
                        ctl->util_max_set = 1;
                        validate_util(ctl->util_max);
-                       optind++;
                        break;
                case 'V':
                        print_version(EXIT_SUCCESS);