[PATCH] uclampset: Fix left over optind++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
---

Sorry not sure how this slipped through. I'm sure I tested it before I posted
the patches but something must have gone wrong in my testing :(

 schedutils/uclampset.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/schedutils/uclampset.c b/schedutils/uclampset.c
index 444e350f4..e09d6a7f9 100644
--- a/schedutils/uclampset.c
+++ b/schedutils/uclampset.c
@@ -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);
-- 
2.25.1




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux