From 423297c9dba419a9a23b11cd4382c0ee42d9b52a Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Tue, 19 Jan 2021 00:00:00 -0600 Subject: [PATCH] all: make buildable again for new 'misc.h' header file With the 4 header files removed in the previous patch, this commit just changes all those obsolete references to that new consolidated 'misc.h' header file instead. Signed-off-by: Jim Warner --- Documentation/bugs.md | 2 +- Makefile.am | 10 ++-------- pgrep.c | 9 ++++----- proc/devname.c | 2 +- proc/namespace.c | 6 +++--- proc/pids.c | 3 +-- proc/readproc.c | 3 +-- proc/readproc.h | 4 ++-- proc/sysinfo.c | 3 +-- proc/test_namespace.c | 2 +- proc/test_sysinfo.c | 2 +- proc/test_uptime.c | 2 +- proc/test_version.c | 2 +- proc/uptime.c | 3 +-- proc/version.c | 2 +- ps/common.h | 2 +- ps/sortformat.c | 2 +- skill.c | 6 +++--- tload.c | 2 +- top/top.c | 4 +--- uptime.c | 2 +- vmstat.c | 2 +- w.c | 3 +-- 23 files changed, 32 insertions(+), 46 deletions(-) diff --git a/Documentation/bugs.md b/Documentation/bugs.md index 62bc98da..71c48b53 100644 --- a/Documentation/bugs.md +++ b/Documentation/bugs.md @@ -67,7 +67,7 @@ variable `linux_version_code` from libproc/version.c. It is the same number as the macro `LINUX_VERSION_CODE` for which the kernel /proc fs code was compiled. -A macro is provide in libproc/version.h to construct the code from its +A macro is provide in libproc/misc.h to construct the code from its components, e.g. > if (linux_version_code < LINUX_VERSION(2,5,41)) > /* blah blah blah */ diff --git a/Makefile.am b/Makefile.am index a8598b5a..fae22631 100644 --- a/Makefile.am +++ b/Makefile.am @@ -253,8 +253,8 @@ proc_libprocps_la_SOURCES = \ proc/procps-private.h \ proc/meminfo.c \ proc/meminfo.h \ + proc/misc.h \ proc/namespace.c \ - proc/namespace.h \ proc/numa.c \ proc/numa.h \ proc/pids.c \ @@ -268,28 +268,22 @@ proc_libprocps_la_SOURCES = \ proc/stat.c \ proc/stat.h \ proc/sysinfo.c \ - proc/sysinfo.h \ proc/version.c \ - proc/version.h \ proc/vmstat.c \ proc/vmstat.h \ proc/wchan.c \ proc/wchan.h \ proc/uptime.c \ - proc/uptime.h \ proc/xtra-procps-debug.h proc_libprocps_la_includedir = $(includedir)/procps/ proc_libprocps_la_include_HEADERS = \ proc/diskstats.h \ proc/meminfo.h \ - proc/namespace.h \ + proc/misc.h \ proc/pids.h \ proc/slabinfo.h \ proc/stat.h \ - proc/sysinfo.h \ - proc/uptime.h \ - proc/version.h \ proc/vmstat.h \ proc/xtra-procps-debug.h diff --git a/pgrep.c b/pgrep.c index c0ebc558..049a9d2e 100644 --- a/pgrep.c +++ b/pgrep.c @@ -55,9 +55,8 @@ #include "signals.h" #include "xalloc.h" -#include +#include #include -#include enum pids_item Items[] = { PIDS_ID_PID, @@ -432,9 +431,9 @@ static int match_strlist (const char *restrict value, const struct el *restrict } static int match_ns (const int pid, - const struct procps_namespaces *match_ns) + const struct procps_ns *match_ns) { - struct procps_namespaces proc_ns; + struct procps_ns proc_ns; int found = 1; int i; @@ -534,7 +533,7 @@ static struct el * select_procs (int *num) #define PIDS_GETSTR(e) PIDS_VAL(EU_ ## e, str, stack, info) #define PIDS_GETSCH(e) PIDS_VAL(EU_ ## e, s_ch, stack, info) struct pids_info *info=NULL; - struct procps_namespaces nsp; + struct procps_ns nsp; struct pids_stack *stack; unsigned long long saved_start_time; /* for new/old support */ int saved_pid = 0; /* for new/old support */ diff --git a/proc/devname.c b/proc/devname.c index b8110c7c..5e2f2594 100644 --- a/proc/devname.c +++ b/proc/devname.c @@ -24,7 +24,7 @@ #include #include #include -#include "version.h" +#include "misc.h" #include "devname.h" // This is the buffer size for a tty name. Any path is legal, diff --git a/proc/namespace.c b/proc/namespace.c index 59079dab..4ea7c404 100644 --- a/proc/namespace.c +++ b/proc/namespace.c @@ -21,7 +21,7 @@ #include #include -#include +#include #include "proc/procps-private.h" #define NSPATHLEN 64 @@ -81,7 +81,7 @@ PROCPS_EXPORT int procps_ns_get_id(const char *name) * * Find all namespaces for the given process. * @pid: Process ID for required process - * @nsp: Pointer to the struct procps_namespaces + * @nsp: Pointer to the struct procps_ns * * Returns: * 0 on success @@ -89,7 +89,7 @@ PROCPS_EXPORT int procps_ns_get_id(const char *name) */ PROCPS_EXPORT int procps_ns_read_pid( const int pid, - struct procps_namespaces *nsp) + struct procps_ns *nsp) { char path[NSPATHLEN+1]; struct stat st; diff --git a/proc/pids.c b/proc/pids.c index 50b27d27..de8fefb0 100644 --- a/proc/pids.c +++ b/proc/pids.c @@ -36,10 +36,9 @@ #include #include +#include #include #include -#include -#include #include #include diff --git a/proc/readproc.c b/proc/readproc.c index 249853b2..0819629b 100644 --- a/proc/readproc.c +++ b/proc/readproc.c @@ -38,10 +38,9 @@ #include "devname.h" #include "escape.h" -#include "namespace.h" +#include "misc.h" #include "pwcache.h" #include "readproc.h" -#include "version.h" // sometimes it's easier to do this manually, w/o gcc helping #ifdef PROF diff --git a/proc/readproc.h b/proc/readproc.h index 51e64d17..17cf348d 100644 --- a/proc/readproc.h +++ b/proc/readproc.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include // the following is development only, forcing display of "[ duplicate ENUM ]" strings // #define FALSE_THREADS /* set most child string fields to NULL */ @@ -141,7 +141,7 @@ typedef struct proc_t { int oom_score, // oom_score (badness for OOM killer) oom_adj; // oom_adj (adjustment to OOM score) - struct procps_namespaces ns; // (ns subdir) inode number of namespaces + struct procps_ns ns; // (ns subdir) inode number of namespaces char *sd_mach, // n/a systemd vm/container name *sd_ouid, // n/a systemd session owner uid diff --git a/proc/sysinfo.c b/proc/sysinfo.c index e20c2fbc..79ba6e5c 100644 --- a/proc/sysinfo.c +++ b/proc/sysinfo.c @@ -32,8 +32,7 @@ #ifdef __CYGWIN__ #include #endif -#include "version.h" -#include "sysinfo.h" /* include self to verify prototypes */ +#include "misc.h" #include "procps-private.h" diff --git a/proc/test_namespace.c b/proc/test_namespace.c index 4ac052a1..3ee68046 100644 --- a/proc/test_namespace.c +++ b/proc/test_namespace.c @@ -20,7 +20,7 @@ #include #include -#include +#include #include "tests.h" int check_name_minus(void *data) diff --git a/proc/test_sysinfo.c b/proc/test_sysinfo.c index 80f627d3..b3dabcf2 100644 --- a/proc/test_sysinfo.c +++ b/proc/test_sysinfo.c @@ -19,7 +19,7 @@ #include #include -#include +#include #include "tests.h" int check_hertz(void *data) diff --git a/proc/test_uptime.c b/proc/test_uptime.c index f9799116..261ecb82 100644 --- a/proc/test_uptime.c +++ b/proc/test_uptime.c @@ -21,7 +21,7 @@ #include #include -#include +#include #include "tests.h" int check_uptime(void *data) diff --git a/proc/test_version.c b/proc/test_version.c index caa06775..8efc1790 100644 --- a/proc/test_version.c +++ b/proc/test_version.c @@ -21,7 +21,7 @@ #include #include -#include +#include #include "tests.h" int check_linux_version(void *data) diff --git a/proc/uptime.c b/proc/uptime.c index fc714d8e..59bd2087 100644 --- a/proc/uptime.c +++ b/proc/uptime.c @@ -31,8 +31,7 @@ #include #include -#include -#include +#include #include "procps-private.h" #define UPTIME_FILE "/proc/uptime" diff --git a/proc/version.c b/proc/version.c index 612e31a0..fdcf2036 100644 --- a/proc/version.c +++ b/proc/version.c @@ -22,8 +22,8 @@ */ #include #include +#include "misc.h" #include "procps-private.h" -#include "version.h" #define PROCFS_OSRELEASE "/proc/sys/kernel/osrelease" diff --git a/ps/common.h b/ps/common.h index 9511c32c..75be2aa3 100644 --- a/ps/common.h +++ b/ps/common.h @@ -14,9 +14,9 @@ #include "../include/nls.h" #include +#include #include #include -#include // --- interface begin |||||||||||||||||||||||||||||||||||||||||||| // ----------------------------------------------------------------------- diff --git a/ps/sortformat.c b/ps/sortformat.c index f507d0f6..da1783d6 100644 --- a/ps/sortformat.c +++ b/ps/sortformat.c @@ -26,7 +26,7 @@ #include -#include "../proc/sysinfo.h" +#include "../proc/misc.h" #include "../include/xalloc.h" #include "common.h" diff --git a/skill.c b/skill.c index 83b2fb16..efc23eef 100644 --- a/skill.c +++ b/skill.c @@ -42,7 +42,7 @@ #include "xalloc.h" #include "rpmatch.h" -#include +#include #include #define DEFAULT_NICE 4 @@ -62,7 +62,7 @@ static const char **cmds; static int *pids; static char **namespaces; static int ns_pid; -static struct procps_namespaces match_namespaces; +static struct procps_ns match_namespaces; static int ns_flags = 0x3f; #define ENLIST(thing,addme) do{ \ @@ -149,7 +149,7 @@ static int match_strlist(const char *value, const int len, const char **list) static int match_ns(const int pid) { - struct procps_namespaces proc_ns; + struct procps_ns proc_ns; int found = 1; int i; diff --git a/tload.c b/tload.c index eca9ef6c..279b4b53 100644 --- a/tload.c +++ b/tload.c @@ -43,7 +43,7 @@ #include "strutils.h" #include "xalloc.h" -#include +#include static char *screen; diff --git a/top/top.c b/top/top.c index a2054f83..9eb8cbdf 100644 --- a/top/top.c +++ b/top/top.c @@ -49,11 +49,9 @@ #include "../include/nls.h" #include +#include #include #include -#include -#include -#include #include "top.h" #include "top_nls.h" diff --git a/uptime.c b/uptime.c index c5eaa3e7..621cb27b 100644 --- a/uptime.c +++ b/uptime.c @@ -28,7 +28,7 @@ #include "fileutils.h" #include "nls.h" -#include +#include static void print_uptime_since() { diff --git a/vmstat.c b/vmstat.c index 269a5a4a..960d03b2 100644 --- a/vmstat.c +++ b/vmstat.c @@ -51,9 +51,9 @@ #include #include +#include #include #include -#include #include #define UNIT_B 1 diff --git a/w.c b/w.c index 9c43bbd6..7813114a 100644 --- a/w.c +++ b/w.c @@ -54,9 +54,8 @@ #include "fileutils.h" #include "nls.h" +#include #include -#include -#include static int ignoreuser = 0; /* for '-u' */ static int oldstyle = 0; /* for '-o' */