summaryrefslogtreecommitdiffstats
path: root/Affinity.c
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2020-11-01 01:09:51 +0100
committerBenny Baumann <BenBE@geshi.org>2020-11-02 22:15:01 +0100
commit45869513bfebba80cc2ab42e4218f68b34b1e6ac (patch)
treef064631dbff141bf1c945db8cff40b7bb82fd169 /Affinity.c
parent61e14d4bb25268593019e6df3eb02264b4ac8e0e (diff)
Embracing branches
Diffstat (limited to 'Affinity.c')
-rw-r--r--Affinity.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Affinity.c b/Affinity.c
index bfa7ceb5..6fb5846c 100644
--- a/Affinity.c
+++ b/Affinity.c
@@ -89,11 +89,14 @@ bool Affinity_set(Process* proc, Arg arg) {
Affinity* Affinity_get(Process* proc, ProcessList* pl) {
cpu_set_t cpuset;
bool ok = (sched_getaffinity(proc->pid, sizeof(cpu_set_t), &cpuset) == 0);
- if (!ok) return NULL;
+ if (!ok)
+ return NULL;
+
Affinity* affinity = Affinity_new(pl);
for (int i = 0; i < pl->cpuCount; i++) {
- if (CPU_ISSET(i, &cpuset))
+ if (CPU_ISSET(i, &cpuset)) {
Affinity_add(affinity, i);
+ }
}
return affinity;
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy