From ede5d99f6c7f4bf715c0420a24c7214538e99be3 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Thu, 28 Jun 2012 00:00:02 -0500 Subject: [PATCH] ps: exploit library changes to cgroup & supgid Signed-off-by: Jim Warner --- ps/output.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/ps/output.c b/ps/output.c index c95e8213..cf02e0a1 100644 --- a/ps/output.c +++ b/ps/output.c @@ -423,12 +423,8 @@ static int pr_comm(char *restrict const outbuf, const proc_t *restrict const pp) static int pr_cgroup(char *restrict const outbuf,const proc_t *restrict const pp) { int rightward = max_rightward; - if(pp->cgroup) { - escaped_copy(outbuf, *pp->cgroup, OUTBUF_SIZE, &rightward); - return max_rightward-rightward; - } - else - return pr_nop(outbuf,pp); + escaped_copy(outbuf, *pp->cgroup, OUTBUF_SIZE, &rightward); + return max_rightward-rightward; } /* Non-standard, from SunOS 5 */ @@ -1147,13 +1143,13 @@ static int pr_sess(char *restrict const outbuf, const proc_t *restrict const pp) static int pr_supgid(char *restrict const outbuf, const proc_t *restrict const pp){ int rightward = max_rightward; - escaped_copy(outbuf, pp->supgid ? pp->supgid : "n/a", OUTBUF_SIZE, &rightward); + escaped_copy(outbuf, pp->supgid, OUTBUF_SIZE, &rightward); return max_rightward-rightward; } static int pr_supgrp(char *restrict const outbuf, const proc_t *restrict const pp){ int rightward = max_rightward; - escaped_copy(outbuf, pp->supgrp ? pp->supgrp : "n/a", OUTBUF_SIZE, &rightward); + escaped_copy(outbuf, pp->supgrp, OUTBUF_SIZE, &rightward); return max_rightward-rightward; } -- 2.40.0