]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
taskset: use lib/procfs.c
authorKarel Zak <kzak@redhat.com>
Tue, 7 Sep 2021 15:39:16 +0000 (17:39 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 6 Oct 2021 09:01:54 +0000 (11:01 +0200)
schedutils/taskset.c

index 56db817924dcb268c456618930de18f228b7f550..224cfbe230b238c82b86a1d6eda90a3766f0115a 100644 (file)
@@ -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);