Show '?' as PID when the PID could not be determined, instead of '0'.

https://answers.launchpad.net/ubuntu/+source/nethogs/+question/113880
This commit is contained in:
Arnout Engelen
2011-08-27 13:26:52 +00:00
parent 807ba06391
commit 07f7c38f00

View File

@@ -85,7 +85,10 @@ void Line::show (int row, unsigned int proglen)
return;
}
mvprintw (3+row, 0, "%d", m_pid);
if (m_pid == 0)
mvprintw (3+row, 0, "?");
else
mvprintw (3+row, 0, "%d", m_pid);
char * username = uid2username(m_uid);
mvprintw (3+row, 6, "%s", username);
free (username);