aboutsummaryrefslogtreecommitdiffstats
path: root/debian/patches
diff options
context:
space:
mode:
authorEugene V. Lyubimkin <jackyf@debian.org>2011-01-16 19:36:07 +0200
committerDaniel Lange <DLange@git.local>2016-04-11 13:00:28 +0200
commit6e8d31964ea33edd470001ee13070e844b269e11 (patch)
tree48b41783f978b511ccfb25260c83717160c8d63b /debian/patches
parent6e545da37e2482b15007df28c549afa072a5198d (diff)
parent283707c5e5bc436b78ea23bf5500cb6b16a01148 (diff)
downloaddebian_htop-6e8d31964ea33edd470001ee13070e844b269e11.tar.gz
debian_htop-6e8d31964ea33edd470001ee13070e844b269e11.tar.bz2
debian_htop-6e8d31964ea33edd470001ee13070e844b269e11.zip
Imported Debian patch 0.9-1debian/0.9-1
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/600-openvz-veid-on-kernels-gt-2.6.18.patch77
-rw-r--r--debian/patches/700-ltrace-support.patch38
2 files changed, 56 insertions, 59 deletions
diff --git a/debian/patches/600-openvz-veid-on-kernels-gt-2.6.18.patch b/debian/patches/600-openvz-veid-on-kernels-gt-2.6.18.patch
index 2543c5c..57e687e 100644
--- a/debian/patches/600-openvz-veid-on-kernels-gt-2.6.18.patch
+++ b/debian/patches/600-openvz-veid-on-kernels-gt-2.6.18.patch
@@ -1,45 +1,42 @@
Fix determining OpenVZ VEID on Linux kernels >= 2.6.18.
Index: htop/ProcessList.c
===================================================================
---- htop.orig/ProcessList.c 2009-04-05 11:48:46.340045591 +0300
-+++ htop/ProcessList.c 2009-04-05 12:22:08.819047243 +0300
-@@ -623,20 +623,28 @@
- process->vpid = process->pid;
- process->ctid = 0;
- } else {
-- snprintf(statusfilename, MAX_NAME, "%s/%s/stat", dirname, name);
-+ snprintf(statusfilename, MAX_NAME, "%s/%s/status", dirname, name);
- status = ProcessList_fopen(this, statusfilename, "r");
- if (status == NULL)
- goto errorReadingProcess;
-- num = ProcessList_fread(this, status,
-- "%*u %*s %*c %*u %*u %*u %*u %*u %*u %*u "
-- "%*u %*u %*u %*u %*u %*u %*u %*u "
-- "%*u %*u %*u %*u %*u %*u %*u %*u "
-- "%*u %*u %*u %*u %*u %*u %*u %*u "
-- "%*u %*u %*u %*u %*u %*u %*u %*u "
-- "%*u %*u %*u %*u %*u %*u %*u "
-- "%*u %*u %u %u",
-- &process->vpid, &process->ctid);
-- fclose(status);
-+ else {
-+ char buffer[256];
-+ process->ctid = 0;
-+ while (!feof(status)) {
-+ char* ok = fgets(buffer, 255, status);
-+ if (!ok)
-+ break;
+--- htop.orig/ProcessList.c 2011-01-16 17:02:59.000000000 +0200
++++ htop/ProcessList.c 2011-01-16 18:05:01.000000000 +0200
+@@ -438,19 +438,26 @@
+ return;
+ }
+ char filename[MAX_NAME+1];
+- snprintf(filename, MAX_NAME, "%s/%s/stat", dirname, name);
++ snprintf(filename, MAX_NAME, "%s/%s/status", dirname, name);
+ FILE* file = fopen(filename, "r");
+ if (!file)
+ return;
+- fscanf(file,
+- "%*u %*s %*c %*u %*u %*u %*u %*u %*u %*u "
+- "%*u %*u %*u %*u %*u %*u %*u %*u "
+- "%*u %*u %*u %*u %*u %*u %*u %*u "
+- "%*u %*u %*u %*u %*u %*u %*u %*u "
+- "%*u %*u %*u %*u %*u %*u %*u %*u "
+- "%*u %*u %*u %*u %*u %*u %*u "
+- "%*u %*u %u %u",
+- &process->vpid, &process->ctid);
+
-+ if (String_startsWith(buffer, "envID:")) {
-+ int ctid;
-+ int ok = ProcessList_read(this, buffer, "envID:\t%d", &ctid);
-+ if (ok >= 1) {
-+ process->ctid = ctid;
-+ }
-+ }
-+ }
-+ fclose(status);
-+ }
- }
- #endif
++ char buffer[256];
++ process->ctid = 0;
++ while (!feof(file)) {
++ char* ok = fgets(buffer, 255, file);
++ if (!ok)
++ break;
++
++ if (String_startsWith(buffer, "envID:")) {
++ int ctid;
++ int ok = sscanf(buffer, "envID:\t%d", &ctid);
++ if (ok >= 1) {
++ process->ctid = ctid;
++ }
++ }
++ }
+ fclose(file);
+ }
diff --git a/debian/patches/700-ltrace-support.patch b/debian/patches/700-ltrace-support.patch
index f4fa6f5..b44b025 100644
--- a/debian/patches/700-ltrace-support.patch
+++ b/debian/patches/700-ltrace-support.patch
@@ -1,8 +1,8 @@
Add support for 'ltrace' in addition to 'strace' support.
Index: htop/TraceScreen.c
===================================================================
---- htop.orig/TraceScreen.c 2009-04-05 11:17:49.000000000 +0300
-+++ htop/TraceScreen.c 2009-04-05 12:26:08.935062271 +0300
+--- htop.orig/TraceScreen.c 2011-01-16 17:02:59.000000000 +0200
++++ htop/TraceScreen.c 2011-01-16 18:15:07.000000000 +0200
@@ -23,11 +23,17 @@
/*{
@@ -23,7 +23,7 @@ Index: htop/TraceScreen.c
}*/
@@ -38,9 +44,10 @@
- static int tbEvents[3] = {KEY_F(4), KEY_F(5), 27};
+ static int tsEvents[] = {KEY_F(4), KEY_F(5), 27};
-TraceScreen* TraceScreen_new(Process* process) {
+TraceScreen* TraceScreen_new(Process* process, TraceType type) {
@@ -31,7 +31,7 @@ Index: htop/TraceScreen.c
this->process = process;
+ this->type = type;
this->display = Panel_new(0, 1, COLS, LINES-2, LISTITEM_CLASS, true, ListItem_compare);
- this->bar = FunctionBar_new(3, tbFunctions, tbKeys, tbEvents);
+ this->bar = FunctionBar_new(tsFunctions, tsKeys, tsEvents);
this->tracing = true;
@@ -56,7 +63,14 @@
static void TraceScreen_draw(TraceScreen* this) {
@@ -95,7 +95,7 @@ Index: htop/TraceScreen.c
if (nread && this->tracing) {
char* line = buffer;
buffer[nread] = '\0';
-@@ -164,6 +187,6 @@
+@@ -171,6 +194,6 @@
}
kill(child, SIGTERM);
waitpid(child, NULL, 0);
@@ -105,8 +105,8 @@ Index: htop/TraceScreen.c
}
Index: htop/TraceScreen.h
===================================================================
---- htop.orig/TraceScreen.h 2009-04-05 11:17:49.000000000 +0300
-+++ htop/TraceScreen.h 2009-04-05 12:26:08.935062271 +0300
+--- htop.orig/TraceScreen.h 2009-06-29 13:18:40.000000000 +0300
++++ htop/TraceScreen.h 2011-01-16 18:15:07.000000000 +0200
@@ -25,15 +25,21 @@
#include "FunctionBar.h"
@@ -132,11 +132,11 @@ Index: htop/TraceScreen.h
Index: htop/htop.1
===================================================================
---- htop.orig/htop.1 2009-04-05 11:17:49.000000000 +0300
-+++ htop/htop.1 2009-04-05 12:26:08.935062271 +0300
-@@ -35,6 +35,11 @@
- will attach it to the currently selected process, presenting a live
- update of system calls issued by the process.
+--- htop.orig/htop.1 2011-01-16 17:02:59.000000000 +0200
++++ htop/htop.1 2011-01-16 18:15:07.000000000 +0200
+@@ -54,6 +54,11 @@
+ Display open files for a process: if lsof(1) is installed, pressing this key
+ will display the list of file descriptors opened by the process.
.TP
+.B l
+Trace process library calls: if ltrace(1) is installed, pressing this key
@@ -148,19 +148,19 @@ Index: htop/htop.1
.TP
Index: htop/htop.c
===================================================================
---- htop.orig/htop.c 2009-04-05 11:48:46.352047326 +0300
-+++ htop/htop.c 2009-04-05 12:26:08.935062271 +0300
-@@ -121,6 +121,7 @@
+--- htop.orig/htop.c 2011-01-16 17:02:59.000000000 +0200
++++ htop/htop.c 2011-01-16 18:15:07.000000000 +0200
+@@ -133,6 +133,7 @@
mvaddstr(19, 0, " F2 S: setup F6 >: select sort column");
- mvaddstr(20, 0, " F1 h: show this help screen");
+ mvaddstr(20, 0, " F1 h: show this help screen l: list open files with lsof");
mvaddstr(21, 0, " F10 q: quit s: trace syscalls with strace");
+ mvaddstr(22, 0, " L: trace library calls with ltrace");
attrset(CRT_colors[HELP_BOLD]);
mvaddstr( 9, 0, " Arrows"); mvaddstr( 9,40, " F5 t");
-@@ -140,10 +141,11 @@
+@@ -152,10 +153,11 @@
mvaddstr(19, 0, " F2 S"); mvaddstr(19,40, " F6 >");
- mvaddstr(20, 0, " F1 h");
+ mvaddstr(20, 0, " ? F1 h"); mvaddstr(20,40, " l");
mvaddstr(21, 0, " F10 q"); mvaddstr(21,40, " s");
+ mvaddstr(22,40, " L");
attrset(CRT_colors[DEFAULT_COLOR]);
@@ -171,7 +171,7 @@ Index: htop/htop.c
attrset(CRT_colors[DEFAULT_COLOR]);
refresh();
CRT_readKey();
-@@ -551,9 +553,20 @@
+@@ -580,9 +582,20 @@
Panel_onKey(panel, KEY_DOWN);
break;
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy