From 08c3ecd608b5ea694b645aa56eadd32b88bb2675 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Mon, 16 May 2011 13:32:42 +0000 Subject: [PATCH] Handle the case where memory stats are in different order, or don't exist on that platform This commit was SVN r24700. --- opal/mca/pstat/linux/pstat_linux_module.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/opal/mca/pstat/linux/pstat_linux_module.c b/opal/mca/pstat/linux/pstat_linux_module.c index 97797b3291..8819e893f4 100644 --- a/opal/mca/pstat/linux/pstat_linux_module.c +++ b/opal/mca/pstat/linux/pstat_linux_module.c @@ -299,7 +299,6 @@ static int query(pid_t pid, data[len] = '\0'; /* parse it according to proc(3) */ - eptr = data; /* look for VmPeak */ if (NULL != (ptr = strstr(data, "VmPeak:"))) { /* found it - step past colon */ @@ -307,14 +306,14 @@ static int query(pid_t pid, stats->peak_vsize = convert_value(ptr); } /* look for VmSize */ - if (NULL != (ptr = strstr(ptr, "VmSize:"))) { + if (NULL != (ptr = strstr(data, "VmSize:"))) { /* found it - step past colon */ ptr += 8; stats->vsize = convert_value(ptr); /* convert to MBytes*/ } /* look for RSS */ - if (NULL != (ptr = strstr(ptr, "VmRSS:"))) { + if (NULL != (ptr = strstr(data, "VmRSS:"))) { /* found it - step past colon */ ptr += 8; stats->rss = convert_value(ptr); /* convert to MBytes */