Would using xasprintf() an option here ? I did not try, but the dn[]+sprintf combo requires that both strings are always the same ... jm2c, re, wh _______________________________________ Von: busybox im Auftrag von Bernhard Reutner-= Fischer Gesendet: Sonntag, 20. Juni 2021 10:18 An: busybox@busybox.net; Denys Vlasenko Cc: Bernhard Reutner-Fischer Betreff: Re: [git commit] taskset: implement -a WARNUNG: Diese E-Mail kam von au=DFerhalb der Organisation. Klicken Sie nic= ht auf Links oder =F6ffnen Sie keine Anh=E4nge, es sei denn, Sie kennen den= /die Absender*in und wissen, dass der Inhalt sicher ist. On 19 June 2021 17:42:35 CEST, Denys Vlasenko wr= ote: >commit: >https://git.busybox.net/busybox/commit/?id=3D25128176c46b169cdec2c18b5730c= 36a940f6eb0 >branch: https://git.busybox.net/busybox/commit/?id=3Drefs/heads/master > >function old new >delta >process_pid_str - 854 >+854 >.rodata 103363 103378 >+15 >packed_usage 33654 33658 >+4 >taskset_main 936 190 >-746 >--------------------------------------------------------------------------= ---- >(add/remove: 1/0 grow/shrink: 2/1 up/down: 873/-746) Total: >127 bytes >+ if (opts & OPT_a) { >+ char dn[sizeof("/proc/%s/task") + 3 * sizeof(int)]; >+ DIR *dir; >+ struct dirent *ent; >+ >+ sprintf(dn, "/proc/%s/task", pid_str); >+ dir =3D opendir(dn); >+ if (!dir) { >+ goto no_threads; >+ } >+ while ((ent =3D readdir(dir)) !=3D NULL) { >+ if (isdigit(ent->d_name[0])) >+ process_pid_str(ent->d_name, opts, aff); >+ } >+ IF_FEATURE_CLEAN_UP(closedir(dir);) Is this opencoded hunk smaller than a variant with recursive_action? thanks, >+ } else { >+ no_threads: >+ process_pid_str(pid_str, opts, aff); >+ } >+ return EXIT_SUCCESS; > } _______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox _______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox