]> granicus.if.org Git - procps-ng/commitdiff
top: ensure /proc is mounted before term is diddled
authorJim Warner <james.warner@comcast.net>
Wed, 25 Apr 2012 04:08:02 +0000 (23:08 -0500)
committerCraig Small <csmall@enc.com.au>
Wed, 25 Apr 2012 05:23:22 +0000 (15:23 +1000)
Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c

index 108805ba6bfce0cd0e638996b7a74e6765c442d8..da0737076c3cf022dee1eeaec3b890d8ae79c44a 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -2101,9 +2101,13 @@ static void sysinfo_refresh (int forced) {
          * 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;
    int i;
 
+   // is /proc mounted?
+   look_up_our_self(&p);
+
    // setup our program name
    Myname = strrchr(me, '/');
    if (Myname) ++Myname; else Myname = me;