]> granicus.if.org Git - procps-ng/commitdiff
top: trade 'look_up_our_self' for a new API equivalent
authorJim Warner <james.warner@comcast.net>
Fri, 11 Sep 2015 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@enc.com.au>
Mon, 21 Sep 2015 12:39:10 +0000 (22:39 +1000)
With the advent of the 'fatal_proc_unmounted' function
in the <pids.h> API to ensure the /proc filesystem was
mounted, we will finally get rid of the last remaining
vestiges of the former libprocps <readproc> interface.

[ also play a little catch up and whack some headers ]
[ that are not necessary now, beyond that readproc.h ]

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

index 8418896e0d5d4b1c4857370bb4781be2be9a03f6..36b7da76923d1814f8b5b3e4faeec7ce46467098 100644 (file)
--- a/top/top.c
+++ b/top/top.c
 #include "../include/signals.h"
 #include "../include/nls.h"
 
-#include "../proc/devname.h"
 #include <proc/meminfo.h>
 #include <proc/pids.h>
-#include "../proc/procps.h"
-#include "../proc/readproc.h"
 #include <proc/readstat.h>
-#include "../proc/sysinfo.h"
+#include <proc/sysinfo.h>
 #include <proc/version.h>
-#include "../proc/wchan.h"
 #include <proc/uptime.h>
 
 #include "top.h"
@@ -2873,7 +2869,6 @@ 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;
    int i;
    int linux_version_code = procps_linux_version();
@@ -2881,7 +2876,7 @@ static void before (char *me) {
    atexit(close_stdout);
 
    // is /proc mounted?
-   look_up_our_self(&p);
+   fatal_proc_unmounted(NULL, 0);
 
    // setup our program name
    Myname = strrchr(me, '/');