]> granicus.if.org Git - procps-ng/commitdiff
top: respond to library changes regarding self lookups
authorJim Warner <james.warner@comcast.net>
Sun, 23 Aug 2015 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@enc.com.au>
Wed, 26 Aug 2015 12:42:02 +0000 (22:42 +1000)
Just in case, make the old proc_t used in the before()
function static so valgrind doesn't get his panties in
a bunch over the fact the 'cmd' is now dynamic memory.

[ Shouldn't that function, or an equivalent, also be ]
[ part of our new library's implementation? However, ]
[ is it proper for a brand new library to abnormally ]
[ terminate a calling process with a stderr message? ]

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

index 29b685643f533aba527c8bfb235f9c5846cc8144..328e8009247abc8b87f53c76b06a14a087df2ace 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -2889,8 +2889,8 @@ signify_that:
          * No matter what *they* say, we handle the really really BIG and
          * IMPORTANT stuff upon which all those lessor functions depend! */
 static void before (char *me) {
+   static proc_t p;
    struct sigaction sa;
-   proc_t p;
    int i;
    int linux_version_code = procps_linux_version();