From: Jim Warner Date: Wed, 25 Apr 2012 04:08:02 +0000 (-0500) Subject: top: ensure /proc is mounted before term is diddled X-Git-Tag: v3.3.3~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=04ca0b1cbf978a7accb0404340e5355e33b2084a;p=procps-ng top: ensure /proc is mounted before term is diddled Signed-off-by: Jim Warner --- diff --git a/top/top.c b/top/top.c index 108805ba..da073707 100644 --- 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;