On Sat, Nov 6, 2010 at 6:06 PM, Lauri Kasanen <[email protected]> wrote:
> Really attach the patch...
read_proc() is still badly indented.
+ if ((pid = (pid_t) atoi(de->d_name)) != 0) {
+ path = xasprintf("%s/%d/stat", PROC_BASE, pid);
+ if ((file = fopen(path, "r")) != NULL) {
Please do not assign in the if(). This fragment should look like this:
pid = atoi(de->d_name);
if (pid != 0) {
path = xasprintf("%s/%d/stat", PROC_BASE, pid);
file = fopen_for_read(path);
if (file != NULL) {
BTW: xasprintf("%s/%d/stat", PROC_BASE, pid);
may be bigger than xasprintf(PROC_BASE"/%d/stat", pid);
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox