Репозиторий Sisyphus
Последнее обновление: 18 сентября 2019 | Пакетов: 17444 | Посещений: 15117936
en ru br
Репозитории ALT
S:0.8.5-alt1
5.1: 0.7.0-alt1
www.altlinux.org/Changes

Группа :: Мониторинг
Пакет: nethogs

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: nethogs-0.8.0-alt-pid32.patch
Скачать


diff -Naur nethogs-orig/cui.cpp nethogs/cui.cpp
--- nethogs-orig/cui.cpp	2011-08-27 16:25:22.000000000 +0300
+++ nethogs/cui.cpp	2011-10-14 10:14:27.045597977 +0300
@@ -77,7 +77,7 @@
 void Line::show (int row, unsigned int proglen)
 {
 	assert (m_pid >= 0);
-	assert (m_pid <= 100000);
+	/*assert (m_pid <= 100000);*/
 
 	if (DEBUG || tracemode)
 	{
@@ -87,10 +87,15 @@
 
 	if (m_pid == 0)
 		mvprintw (3+row, 0, "?");
-	else
-		mvprintw (3+row, 0, "%d", m_pid);
+	else {
+		/* for testing only:
+		unsigned int  _m_pid = 0xFFFFFFFF;
+		mvprintw (3+row, 0, "%u", _m_pid);
+		*/
+		mvprintw (3+row, 0, "%u", m_pid);
+	}
 	char * username = uid2username(m_uid);
-	mvprintw (3+row, 6, "%s", username);
+	mvprintw (3+row, 16, "%s", username);
 	free (username);
 	if (strlen (m_name) > proglen) {
 		// truncate oversized names
@@ -98,29 +103,29 @@
 		char * start = tmp + strlen (m_name) - proglen;
 		start[0] = '.';
 		start[1] = '.';
-		mvprintw (3+row, 6 + 9, "%s", start);
+		mvprintw (3+row, 16 + 9, "%s", start);
 		free (tmp);
 	} else {
-		mvprintw (3+row, 6 + 9, "%s", m_name);
+		mvprintw (3+row, 16 + 9, "%s", m_name);
 	}
-	mvprintw (3+row, 6 + 9 + proglen + 2, "%s", devicename);
-	mvprintw (3+row, 6 + 9 + proglen + 2 + 6, "%10.3f", sent_value);
-	mvprintw (3+row, 6 + 9 + proglen + 2 + 6 + 9 + 3, "%10.3f", recv_value);
+	mvprintw (3+row, 16 + 9 + proglen + 2, "%s", devicename);
+	mvprintw (3+row, 16 + 9 + proglen + 2 + 6, "%10.3f", sent_value);
+	mvprintw (3+row, 16 + 9 + proglen + 2 + 6 + 9 + 3, "%10.3f", recv_value);
 	if (viewMode == VIEWMODE_KBPS)
 	{
-		mvprintw (3+row, 6 + 9 + proglen + 2 + 6 + 9 + 3 + 11, "KB/sec");
+		mvprintw (3+row, 16 + 9 + proglen + 2 + 6 + 9 + 3 + 11, "KB/sec");
 	}
 	else if (viewMode == VIEWMODE_TOTAL_MB)
 	{
-		mvprintw (3+row, 6 + 9 + proglen + 2 + 6 + 9 + 3 + 11, "MB    ");
+		mvprintw (3+row, 16 + 9 + proglen + 2 + 6 + 9 + 3 + 11, "MB    ");
 	}
 	else if (viewMode == VIEWMODE_TOTAL_KB)
 	{
-		mvprintw (3+row, 6 + 9 + proglen + 2 + 6 + 9 + 3 + 11, "KB    ");
+		mvprintw (3+row, 16 + 9 + proglen + 2 + 6 + 9 + 3 + 11, "KB    ");
 	}
 	else if (viewMode == VIEWMODE_TOTAL_B)
 	{
-		mvprintw (3+row, 6 + 9 + proglen + 2 + 6 + 9 + 3 + 11, "B     ");
+		mvprintw (3+row, 16 + 9 + proglen + 2 + 6 + 9 + 3 + 11, "B     ");
 	}
 }
 
@@ -318,7 +323,7 @@
 
 	if (col > PROGNAME_WIDTH) col = PROGNAME_WIDTH;
 
-	proglen = col - 53;
+	proglen = col - 63;
 
 	refreshconninode();
 	if (DEBUG || tracemode)
@@ -330,7 +335,7 @@
 		clear();
 		mvprintw (0, 0, "%s", caption->c_str());
 		attron(A_REVERSE);
-		mvprintw (2, 0, "  PID USER     %-*.*s  DEV        SENT      RECEIVED       ", proglen, proglen, "PROGRAM");
+		mvprintw (2, 0, "  PID           USER     %-*.*s  DEV        SENT      RECEIVED       ", proglen, proglen, "PROGRAM");
 		attroff(A_REVERSE);
 	}
 	ProcList * curproc = processes;
@@ -460,7 +465,7 @@
 
 	if ((!tracemode) && (!DEBUG)){
 		attron(A_REVERSE);
-		mvprintw (3+1+i, 0, "  TOTAL        %-*.*s        %10.3f  %10.3f ", proglen, proglen, " ", sent_global, recv_global);
+		mvprintw (3+1+i, 0, "  TOTAL                  %-*.*s        %10.3f  %10.3f ", proglen, proglen, " ", sent_global, recv_global);
 		if (viewMode == VIEWMODE_KBPS)
 		{
 			mvprintw (3+1+i, col - 7, "KB/sec ");
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin