From 5bee9026651e4f2f07e524dce7c9d8da75eafa19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Fri, 28 Aug 2020 11:54:50 +0200 Subject: Drop configure option --enable-proc Move to HTOP_LINUX, as --enable-proc implies my_htop_platform=linux, and the Linux features do not work without a proc fs. --- configure.ac | 7 ------- htop.c | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 18291b95..e46b6eba 100644 --- a/configure.ac +++ b/configure.ac @@ -111,13 +111,6 @@ AC_SUBST(wextra_flag) # ---------------------------------------------------------------------- PROCDIR=/proc -AC_ARG_ENABLE(proc, [AS_HELP_STRING([--enable-proc], [use Linux-compatible proc filesystem])], enable_proc="yes", enable_proc="no") -if test "x$enable_proc" = xyes; then - # An enabled proc assumes we're emulating Linux. - my_htop_platform=linux - AC_DEFINE(HAVE_PROC, 1, [Define if using a Linux-compatible proc filesystem.]) -fi - AC_ARG_WITH(proc, [AS_HELP_STRING([--with-proc=DIR], [Location of a Linux-compatible proc filesystem (default=/proc).])], if test -n "$withval"; then diff --git a/htop.c b/htop.c index 7cdf4e42..c7689c66 100644 --- a/htop.c +++ b/htop.c @@ -200,7 +200,7 @@ int main(int argc, char** argv) { CommandLineSettings flags = parseArguments(argc, argv); // may exit() -#ifdef HAVE_PROC +#ifdef HTOP_LINUX if (access(PROCDIR, R_OK) != 0) { fprintf(stderr, "Error: could not read procfs (compiled to look in %s).\n", PROCDIR); exit(1); -- cgit v1.2.3 From 979d00421454582173aa7caefcb86bd1684fd02b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Fri, 28 Aug 2020 11:56:07 +0200 Subject: Improve indent --- configure.ac | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index e46b6eba..2e73f59a 100644 --- a/configure.ac +++ b/configure.ac @@ -112,12 +112,11 @@ AC_SUBST(wextra_flag) PROCDIR=/proc AC_ARG_WITH(proc, [AS_HELP_STRING([--with-proc=DIR], [Location of a Linux-compatible proc filesystem (default=/proc).])], - -if test -n "$withval"; then - AC_DEFINE_UNQUOTED(PROCDIR, "$withval", [Path of proc filesystem]) - PROCDIR="$withval" -fi, -AC_DEFINE(PROCDIR, "/proc", [Path of proc filesystem])) + if test -n "$withval"; then + AC_DEFINE_UNQUOTED(PROCDIR, "$withval", [Path of proc filesystem]) + PROCDIR="$withval" + fi, + AC_DEFINE(PROCDIR, "/proc", [Path of proc filesystem])) if test "x$cross_compiling" = xno; then if test "x$enable_proc" = xyes; then -- cgit v1.2.3 From 3b084db1c46149e069e8c42053136505c59abb2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Fri, 28 Aug 2020 12:10:31 +0200 Subject: Print configured state --- configure.ac | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/configure.ac b/configure.ac index 2e73f59a..b98dacc0 100644 --- a/configure.ac +++ b/configure.ac @@ -332,3 +332,20 @@ then echo "****************************************************************" echo "" fi + +AC_MSG_RESULT([ + ${PACKAGE_NAME} ${VERSION} + + platform: $my_htop_platform + proc directory: $PROCDIR + openvz: $enable_openvz + cgroup: $enable_cgroup + vserver: $enable_vserver + ancient vserver: $enable_ancient_vserver + taskstats: $enable_taskstats + unicode: $enable_unicode + linux affinity: $enable_linux_affinity + hwlock: $enable_hwloc + setuid: $enable_setuid + linux delay accounting: $enable_delayacct +]) -- cgit v1.2.3 From 3f5784a3f0639e8a8bd01e35619aa2eec462ee8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Fri, 28 Aug 2020 12:19:58 +0200 Subject: Convert hwlock CI run to a full featured one --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b269bd9..d95d0af9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,20 +40,20 @@ jobs: - name: Distcheck run: make distcheck DISTCHECK_CONFIGURE_FLAGS=--enable-werror - build-ubuntu-latest-hwloc: + build-ubuntu-latest-full-featured: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Install Dependencies - run: sudo apt-get install libncursesw5-dev libhwloc-dev + run: sudo apt-get install libncursesw5-dev libhwloc-dev libnl-3-dev libnl-genl-3-dev - name: Bootstrap run: ./autogen.sh - name: Configure - run: ./configure --enable-werror --enable-hwloc + run: ./configure --enable-werror --enable-openvz --enable-cgroup --enable-vserver --enable-ancient-vserver --enable-taskstats --enable-unicode --enable-linux-affinity --enable-hwloc --enable-setuid --enable-delayacct - name: Build run: make - name: Distcheck - run: make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-werror --enable-hwloc' + run: make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-werror --enable-openvz --enable-cgroup --enable-vserver --enable-ancient-vserver --enable-taskstats --enable-unicode --enable-linux-affinity --enable-hwloc --enable-setuid --enable-delayacct' whitespace_check: runs-on: ubuntu-latest -- cgit v1.2.3 From a48ce9d10383a34598d7b0c40bfdb56f775dfc38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Fri, 28 Aug 2020 12:29:24 +0200 Subject: Really tell gcc to ignore return value of fscanf --- linux/LinuxProcessList.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index 6d3d0348..609b347c 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -577,7 +577,7 @@ static void LinuxProcessList_readOpenVZData(LinuxProcess* process, const char* d FILE* file = fopen(filename, "r"); if (!file) return; - (void) fscanf(file, + (void)! fscanf(file, "%*32u %*32s %*1c %*32u %*32u %*32u %*32u %*32u %*32u %*32u " "%*32u %*32u %*32u %*32u %*32u %*32u %*32u %*32u " "%*32u %*32u %*32u %*32u %*32u %*32u %*32u %*32u " -- cgit v1.2.3