From: csbo98 Date: Sun, 22 May 2022 06:47:13 +0000 (+0800) Subject: Maybe there is a little mistake in do_taskset() function in taskset.c. X-Git-Tag: v2.39-rc1~652^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6ff67988785af818b97a7175c8ca80f2ee2d039f;p=thirdparty%2Futil-linux.git Maybe there is a little mistake in do_taskset() function in taskset.c. In the first call of sched_getaffinity(), if the call is failed we should use err_affinity(ts->pid, 0) other than err_affinity(ts->pid, 1). --- diff --git a/schedutils/taskset.c b/schedutils/taskset.c index 224cfbe230..0ab7d12e20 100644 --- a/schedutils/taskset.c +++ b/schedutils/taskset.c @@ -117,7 +117,7 @@ static void do_taskset(struct taskset *ts, size_t setsize, cpu_set_t *set) /* read the current mask */ if (ts->pid) { if (sched_getaffinity(ts->pid, ts->setsize, ts->set) < 0) - err_affinity(ts->pid, 1); + err_affinity(ts->pid, 0); print_affinity(ts, FALSE); }