summaryrefslogtreecommitdiffstats
path: root/Process.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2014-05-03 17:26:11 -0300
committerHisham Muhammad <hisham@gobolinux.org>2014-05-03 17:26:11 -0300
commitc3e66b2d81d90b4ef0368e61ad3d67d0f062577d (patch)
tree3b988f721753483142501afbaf8359812b9cc8e5 /Process.c
parentebd5de37acc36a34f6f43910eb6f4f1f38025e7f (diff)
Make VPID use PID-width format. Closes #79.
Diffstat (limited to 'Process.c')
-rw-r--r--Process.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/Process.c b/Process.c
index 708067aa..7e94bb04 100644
--- a/Process.c
+++ b/Process.c
@@ -262,7 +262,7 @@ const char *Process_fieldTitles[] = {
" CODE ", " DATA ", " LIB ", " DIRTY ", " UID ", "CPU% ", "MEM% ",
"USER ", " TIME+ ", "NLWP ", " TGID ",
#ifdef HAVE_OPENVZ
- " CTID ", " VPID ",
+ " CTID ", " VPID ",
#endif
#ifdef HAVE_VSERVER
" VXID ",
@@ -295,6 +295,9 @@ void Process_getMaxPid() {
if (maxPid > 99999) {
Process_fieldTitles[PID] = " PID ";
Process_fieldTitles[PPID] = " PPID ";
+ #ifdef HAVE_OPENVZ
+ Process_fieldTitles[VPID] = " VPID ";
+ #endif
Process_fieldTitles[TPGID] = " TPGID ";
Process_fieldTitles[TGID] = " TGID ";
Process_fieldTitles[PGRP] = " PGRP ";
@@ -307,6 +310,9 @@ void Process_getMaxPid() {
} else {
Process_fieldTitles[PID] = " PID ";
Process_fieldTitles[PPID] = " PPID ";
+ #ifdef HAVE_OPENVZ
+ Process_fieldTitles[VPID] = " VPID ";
+ #endif
Process_fieldTitles[TPGID] = "TPGID ";
Process_fieldTitles[TGID] = " TGID ";
Process_fieldTitles[PGRP] = " PGRP ";
@@ -593,8 +599,8 @@ static void Process_writeField(Process* this, RichString* str, ProcessField fiel
}
case STARTTIME: snprintf(buffer, n, "%s", this->starttime_show); break;
#ifdef HAVE_OPENVZ
- case CTID: snprintf(buffer, n, "%5u ", this->ctid); break;
- case VPID: snprintf(buffer, n, "%5u ", this->vpid); break;
+ case CTID: snprintf(buffer, n, "%7u ", this->ctid); break;
+ case VPID: snprintf(buffer, n, Process_pidFormat, this->vpid); break;
#endif
#ifdef HAVE_VSERVER
case VXID: snprintf(buffer, n, "%5u ", this->vxid); break;

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