diff options
author | Timothy Redaelli <drizzt@gentoo.org> | 2009-03-04 21:51:08 +0000 |
---|---|---|
committer | Timothy Redaelli <drizzt@gentoo.org> | 2009-03-04 21:51:08 +0000 |
commit | b901efdd4b5ffdd22bbaf1b9c494b647cc5e3262 (patch) | |
tree | 8a81c13bac10b0b72b339847a5a45b0cdd938fb3 /sys-process/htop/files | |
parent | Version bump (fixes memory leaks and segfaults). Dropping old. (diff) | |
download | historical-b901efdd4b5ffdd22bbaf1b9c494b647cc5e3262.tar.gz historical-b901efdd4b5ffdd22bbaf1b9c494b647cc5e3262.tar.bz2 historical-b901efdd4b5ffdd22bbaf1b9c494b647cc5e3262.zip |
Patch for not-Linux hosts.
Authorized by gentoofan23
Package-Manager: portage-2.2_rc23/cvs/Linux x86_64
Diffstat (limited to 'sys-process/htop/files')
-rw-r--r-- | sys-process/htop/files/htop-0.8.1-no-plpa.patch | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/sys-process/htop/files/htop-0.8.1-no-plpa.patch b/sys-process/htop/files/htop-0.8.1-no-plpa.patch new file mode 100644 index 000000000000..ee89da35bd4b --- /dev/null +++ b/sys-process/htop/files/htop-0.8.1-no-plpa.patch @@ -0,0 +1,111 @@ +Not-linux hosts does not support PLPA. +Since htop works also without it, why not? + +Original patch from FreeBSD by Yi-Jheng Lin <yzlin@cs.nctu.edu.tw> +Modified to be conditional by Timothy Redaelli <drizzt@gentoo.org> + +https://bugs.gentoo.org/220469 + +--- configure.ac ++++ configure.ac +@@ -97,8 +97,9 @@ + + PLPA_INCLUDED(plpa-1.1) + PLPA_INIT(plpa_happy=yes, plpa_happy=no) +-if test "x$plpa_happy" = xno; then +- AC_MSG_ERROR([Failed to initialize PLPA.]) ++AM_CONDITIONAL([HAVE_PLPA], [test "$plpa_happy" = "yes"]) ++if test "$plpa_happy" = "yes"; then ++ AC_DEFINE([HAVE_PLPA], [1], [Have plpa]) + fi + + AC_CONFIG_FILES([Makefile]) +--- htop.c ++++ htop.c +@@ -112,9 +112,11 @@ + mvaddstr(15, 0, " F9 k: kill process/tagged processes P: sort by CPU%"); + mvaddstr(16, 0, " + [ F7: lower priority (+ nice) M: sort by MEM%"); + mvaddstr(17, 0, " - ] F8: higher priority (root only) T: sort by TIME"); ++#ifdef HAVE_PLPA + if (pl->processorCount > 1) + mvaddstr(18, 0, " a: set CPU affinity F4 I: invert sort order"); + else ++#endif + mvaddstr(18, 0, " F4 I: invert sort order"); + mvaddstr(19, 0, " F2 S: setup F6 >: select sort column"); + mvaddstr(20, 0, " F1 h: show this help screen"); +@@ -131,8 +133,10 @@ + mvaddstr(16, 0, " + [ F7"); mvaddstr(16,40, " M"); + mvaddstr(17, 0, " - ] F8"); mvaddstr(17,40, " T"); + mvaddstr(18,40, " F4 I"); ++#if HAVE_PLPA + if (pl->processorCount > 1) + mvaddstr(18, 0, " a:"); ++#endif + mvaddstr(19, 0, " F2 S"); mvaddstr(19,40, " F6 >"); + mvaddstr(20, 0, " F1 h"); + mvaddstr(21, 0, " F10 q"); mvaddstr(21,40, " s"); +@@ -630,6 +634,7 @@ + refreshTimeout = 0; + break; + } ++#ifdef HAVE_PLPA + case 'a': + { + if (pl->processorCount == 1) +@@ -665,6 +670,7 @@ + refreshTimeout = 0; + break; + } ++#endif + case KEY_F(10): + case 'q': + quit = 1; +--- Process.c ++++ Process.c +@@ -28,7 +28,9 @@ + #include <pwd.h> + #include <sched.h> + ++#ifdef HAVE_PLPA + #include <plpa.h> ++#endif + + // This works only with glibc 2.1+. On earlier versions + // the behavior is similar to have a hardcoded page size. +@@ -493,6 +495,7 @@ + return (err == 0); + } + ++#ifdef HAVE_PLPA + unsigned long Process_getAffinity(Process* this) { + unsigned long mask = 0; + plpa_sched_getaffinity(this->pid, sizeof(unsigned long), (plpa_cpu_set_t*) &mask); +@@ -502,6 +505,7 @@ + bool Process_setAffinity(Process* this, unsigned long mask) { + return (plpa_sched_setaffinity(this->pid, sizeof(unsigned long), (plpa_cpu_set_t*) &mask) == 0); + } ++#endif + + void Process_sendSignal(Process* this, int signal) { + kill(this->pid, signal); +--- Makefile.am ++++ Makefile.am +@@ -1,5 +1,7 @@ + ++if HAVE_PLPA + SUBDIRS = plpa-1.1 ++endif + + bin_PROGRAMS = htop + dist_man_MANS = htop.1 +@@ -35,7 +37,9 @@ + + BUILT_SOURCES = $(myhtopheaders) + htop_SOURCES = $(myhtopheaders) $(myhtopsources) config.h debug.h ++if HAVE_PLPA + htop_LDADD = $(top_builddir)/plpa-1.1/src/libplpa_included.la ++endif + + profile: + $(MAKE) all CFLAGS="-pg -O2" |