From: Karel Zak Date: Tue, 7 Sep 2021 15:39:16 +0000 (+0200) Subject: taskset: use lib/procfs.c X-Git-Tag: v2.38-rc1~144^2~108 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c704e680edc85757df3ef9d48e9847be95b1db37;p=thirdparty%2Futil-linux.git taskset: use lib/procfs.c --- diff --git a/schedutils/taskset.c b/schedutils/taskset.c index 56db817924..224cfbe230 100644 --- a/schedutils/taskset.c +++ b/schedutils/taskset.c @@ -31,7 +31,7 @@ #include "nls.h" #include "strutils.h" #include "xalloc.h" -#include "procutils.h" +#include "procfs.h" #include "c.h" #include "closestream.h" @@ -228,10 +228,13 @@ int main(int argc, char **argv) } if (all_tasks && pid) { - struct proc_tasks *tasks = proc_open_tasks(pid); - while (!proc_next_tid(tasks, &ts.pid)) + DIR *sub = NULL; + struct path_cxt *pc = ul_new_procfs_path(pid, NULL); + + while (pc && procfs_process_next_tid(pc, &sub, &ts.pid) == 0) do_taskset(&ts, new_setsize, new_set); - proc_close_tasks(tasks); + + ul_unref_path(pc); } else { ts.pid = pid; do_taskset(&ts, new_setsize, new_set);