From 64a4cd893eb477a1828fb6785ad6292c88c5fabb Mon Sep 17 00:00:00 2001 From: Quinn Date: Thu, 20 Mar 2025 18:30:46 +0100 Subject: [PATCH] fix: when -v is not set, not all cpus are disabled removed the else if check, and use a continue, if pattern instead --- src/main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 575b851..6732885 100644 --- a/src/main.c +++ b/src/main.c @@ -50,10 +50,14 @@ int32_t main(int32_t argc, char** argv) { continue; } - if (cpu_setter(id, false, opts) && (opts & OPT_VERBOSE)) + if (cpu_setter(id, false, opts) && (opts & OPT_VERBOSE)) { printf(cpu_set_log, id, 0); - else if (!(opts & OPT_SET_ALL)) - break; // break if OPT_SET_ALL is not set (assuming the rest of the CPUs are already off) + continue; + } + + // break if OPT_SET_ALL is not set (assuming the rest of the CPUs are already off) + if (!(opts & OPT_SET_ALL)) + break; } if ((opts & OPT_LIST_CORES))