From 29781310b7c874032adf2bfff1386bf192f2e35c Mon Sep 17 00:00:00 2001 From: hume-github Date: Thu, 27 Sep 2012 10:43:09 -0300 Subject: [PATCH] ARG_MAX on Solaris is *very* large, 2 MB. Allocating that much on the stack (local variable) overflows the thread stack and crashes the process in weird and interesting ways. "int i" is a useless variable and breaks the build with -Werror. Signed-off-by: Florian Forster --- src/processes.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/processes.c b/src/processes.c index dcdaaf29..c77859d9 100644 --- a/src/processes.c +++ b/src/processes.c @@ -1230,10 +1230,8 @@ static int ps_read_process(int pid, procstat_t *ps, char *state) { char filename[64]; char f_psinfo[64], f_usage[64]; - int i; char *buffer; - pstatus_t *myStatus; psinfo_t *myInfo; prusage_t *myUsage; @@ -2080,7 +2078,7 @@ static int ps_read (void) procstat_t *ps_ptr; char state; - char cmdline[ARG_MAX]; + char cmdline[PRARGSZ]; ps_list_reset (); -- 2.11.0