]> granicus.if.org Git - procps-ng/commitdiff
enable PROC_FILLSTAT
authoralbert <>
Sun, 8 Dec 2002 18:51:56 +0000 (18:51 +0000)
committeralbert <>
Sun, 8 Dec 2002 18:51:56 +0000 (18:51 +0000)
proc/readproc.c

index 83ef66aab620b8c8c5e3d3a15f4d38dc338fc692..7289585ea0a20898b1e799bbed750b72411137c2 100644 (file)
@@ -404,9 +404,11 @@ next_proc:                         /* get next PID for consideration */
     p->secsid = secsid;
 #endif
 
-    if ((file2str(path, "stat", sbuf, sizeof sbuf)) == -1)
-       goto next_proc;                 /* error reading /proc/#/stat */
-    stat2proc(sbuf, p);                                /* parse /proc/#/stat */
+    if (flags & PROC_FILLSTAT) {         /* read, parse /proc/#/stat */
+       if ((file2str(path, "stat", sbuf, sizeof sbuf)) == -1)
+           goto next_proc;                     /* error reading /proc/#/stat */
+       stat2proc(sbuf, p);                             /* parse /proc/#/stat */
+    }
 
     if (flags & PROC_FILLMEM) {                                /* read, parse /proc/#/statm */
        if ((file2str(path, "statm", sbuf, sizeof sbuf)) != -1 )