]> granicus.if.org Git - procps-ng/commitdiff
library: swat (now) obvious bug from PROCPS_PIDS_extra
authorJim Warner <james.warner@comcast.net>
Sun, 6 Sep 2015 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@enc.com.au>
Mon, 7 Sep 2015 08:11:48 +0000 (18:11 +1000)
I can't remember during what sleepy hour that enum was
added to pids.h, but it damn sure fell short of a full
implementation by approximately 1,000,000 miles or so.

Strangely it surfaced on Craig's system seemingly ggdb
related whereas on mine, a segmentation fault was only
seen when that -h (no header) argument was being used.

Oh well, the road to its resolution also offered us an
opportunity to cleanup some other items along the way.

Reference(s):
http://www.freelists.org/post/procps/newlib-at-the-precipice,4

Signed-off-by: Jim Warner <james.warner@comcast.net>
proc/pids.c

index 16eac33a865faa16fec252eb8ae47e82e1673a54..37a1e9f020e7e66cd3de0e2fc40016245c871aac 100644 (file)
@@ -222,6 +222,7 @@ setDECL(VM_USED)      { (void)I; R->result.ul_int = P->vm_swap + P->vm_rss; }
 REG_set(VSIZE_PGS,        ul_int,  vsize)
 ADR_set(WCHAN_ADDR,       addr,    wchan)
 setDECL(WCHAN_NAME)   { (void)I; R->result.str = strdup(lookup_wchan(P->tid)); }
+setDECL(xtra)         { (void)I; (void)R; (void)P; return; }
 setDECL(noop)         { (void)I; (void)R; (void)P; return; }
 setDECL(logical_end)  { (void)I; (void)R; (void)P; return; }
 setDECL(physical_end) { (void)I; (void)R; (void)P; return; }
@@ -461,6 +462,7 @@ static struct {
     { RS(VSIZE_PGS),         f_stat,     NULL,      QS(ul_int),   0       },
     { RS(WCHAN_ADDR),        f_stat,     NULL,      QS(addr),     0       },
     { RS(WCHAN_NAME),        0,          FF(str),   QS(str),      0       },
+    { RS(xtra),              0,          NULL,      QS(noop),     0       },
     { RS(noop),              0,          NULL,      QS(noop),     0       },
     { RS(logical_end),       0,          NULL,      QS(noop),     0       },
     { RS(physical_end),      0,          NULL,      QS(noop),     0       }