]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
Maybe there is a little mistake in do_taskset() function in taskset.c.
authorcsbo98 <boliu98@foxmail.com>
Sun, 22 May 2022 06:47:13 +0000 (14:47 +0800)
committercsbo98 <boliu98@foxmail.com>
Sun, 22 May 2022 06:47:13 +0000 (14:47 +0800)
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).

schedutils/taskset.c

index 224cfbe230b238c82b86a1d6eda90a3766f0115a..0ab7d12e20775de50c8dc7a8e7f39c73849efdc0 100644 (file)
@@ -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);
        }