From 3df6c8c1191f8efa0fd54802a90290cb639c25b7 Mon Sep 17 00:00:00 2001 From: csbo98 Date: Sun, 22 May 2022 14:47:13 +0800 Subject: [PATCH] taskset: fix use of err_affinity() 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). Signed-off-by: Karel Zak --- schedutils/taskset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.47.2