diff options
author | Daniel Lange <DLange@git.local> | 2021-08-02 15:21:07 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2021-08-02 15:21:07 +0200 |
commit | ed82ce6456f0f904a0ab2b346b85d7cf46df109c (patch) | |
tree | 1b02b20548da6dbcdf53872c3c99a3c013588fd1 /Action.c | |
parent | e341217fea844e1c45b7079146b9de7cb68e8c2a (diff) | |
parent | edf236f9fcf257c5266cead0c3bc45087d937e65 (diff) |
Merge branch 'cpu_count' of cgzones/htop
Diffstat (limited to 'Action.c')
-rw-r--r-- | Action.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -34,7 +34,7 @@ in the source distribution for its full text. #include "Vector.h" #include "XUtils.h" -#if (defined(HAVE_LIBHWLOC) || defined(HAVE_LINUX_AFFINITY)) +#if (defined(HAVE_LIBHWLOC) || defined(HAVE_AFFINITY)) #include "Affinity.h" #include "AffinityPanel.h" #endif @@ -302,10 +302,10 @@ static Htop_Reaction actionSetAffinity(State* st) { if (Settings_isReadonly()) return HTOP_OK; - if (st->pl->cpuCount == 1) + if (st->pl->activeCPUs == 1) return HTOP_OK; -#if (defined(HAVE_LIBHWLOC) || defined(HAVE_LINUX_AFFINITY)) +#if (defined(HAVE_LIBHWLOC) || defined(HAVE_AFFINITY)) const Process* p = (const Process*) Panel_getSelected((Panel*)st->mainPanel); if (!p) return HTOP_OK; @@ -328,8 +328,11 @@ static Htop_Reaction actionSetAffinity(State* st) { Affinity_delete(affinity2); } Object_delete(affinityPanel); -#endif return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR; +#else + return HTOP_OK; +#endif + } static Htop_Reaction actionKill(State* st) { @@ -484,7 +487,7 @@ static const struct { { .key = " F9 k: ", .roInactive = true, .info = "kill process/tagged processes" }, { .key = " F7 ]: ", .roInactive = true, .info = "higher priority (root only)" }, { .key = " F8 [: ", .roInactive = false, .info = "lower priority (+ nice)" }, -#if (defined(HAVE_LIBHWLOC) || defined(HAVE_LINUX_AFFINITY)) +#if (defined(HAVE_LIBHWLOC) || defined(HAVE_AFFINITY)) { .key = " a: ", .roInactive = true, .info = "set CPU affinity" }, #endif { .key = " e: ", .roInactive = false, .info = "show process environment" }, |