From: vx8400 <vx8400@gmail.com>
To: ALT Linux Sisyphus discussions <sisyphus@lists.altlinux.org>
Subject: Re: [sisyphus] [#56683] TESTED srpm=nethogs-0.8.0-alt2.src.rpm
Date: Thu, 13 Oct 2011 18:58:21 +0200
Message-ID: <CAMBdDKpCxcOvMcXY9g2n2t1-Evu20p6gn0eguW1vN5s4+OgnVQ@mail.gmail.com> (raw)
In-Reply-To: <20111013140715.GP20105@osdn.org.ua>
[-- Attachment #1: Type: text/plain, Size: 898 bytes --]
mvprintw (3+row, 0, "%u", m_pid) должно работать (cui.cpp.patch в прицепе).
wbr,
Oleg.
13 октября 2011 г. 16:07 пользователь Michael Shigorin
<mike@osdn.org.ua> написал:
> On Thu, Oct 13, 2011 at 03:57:49PM +0400, Girar Builder robot wrote:
>> http://git.altlinux.org/tasks/56683/logs/events.1.1.log
>>
>> 2011-Oct-13 15:53:11 :: test-only task #56683 for sisyphus started by mike:
>> #100 build nethogs-0.8.0-alt2.src.rpm
>
> Если кто пользуется софтинкой (или попробовал и не вышло):
> в этой сборке приложен хак на скору руку, чтоб оно не падало
> при виде 32-битных PID. Добиться их собственно отображения не
> удалось -- вываливает "?", что должно иметь место при m_pid == 0
> (cui.cpp +88). Буду благодарен за более полное исправление,
> а хак пока предложил апстриму с соответствующим комментарием:
> https://sourceforge.net/tracker/?func=detail&aid=3422416&group_id=110349&atid=656355
[-- Attachment #2: cui.cpp.patch --]
[-- Type: text/x-patch, Size: 2224 bytes --]
--- cui.cpp.orig 2011-10-13 18:52:18.561304006 +0200
+++ cui.cpp 2011-10-13 18:54:35.341313307 +0200
@@ -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 ");
}
}
prev parent reply other threads:[~2011-10-13 16:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-13 14:07 ` Michael Shigorin
2011-10-13 16:58 ` vx8400 [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMBdDKpCxcOvMcXY9g2n2t1-Evu20p6gn0eguW1vN5s4+OgnVQ@mail.gmail.com \
--to=vx8400@gmail.com \
--cc=sisyphus@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Sisyphus discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
public-inbox-index sisyphus
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.sisyphus
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git