From 8924f4e4ad35ef62cab104e42757c62798060a84 Mon Sep 17 00:00:00 2001 From: Mark Borgerding Date: Wed, 18 Jul 2012 00:10:47 -0400 Subject: [PATCH] check return value from system call --- test/pstats.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/pstats.c b/test/pstats.c index bb2244e..596826c 100644 --- a/test/pstats.c +++ b/test/pstats.c @@ -36,7 +36,9 @@ static void ps_report(void) #else /* GNU/Linux */ sprintf(buf,"ps -o comm,majflt,minflt,rss,drs,pagein,sz,trs,vsz %d 1>&2",getpid() ); #endif - system( buf ); + if (system( buf )==-1) { + perror("system call to ps failed"); + } } void pstats_report()