Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
c3e66b2d
Commit
c3e66b2d
authored
May 03, 2014
by
Hisham Muhammad
Browse files
Make VPID use PID-width format. Closes #79.
parent
ebd5de37
Changes
1
Hide whitespace changes
Inline
Side-by-side
Process.c
View file @
c3e66b2d
...
@@ -262,7 +262,7 @@ const char *Process_fieldTitles[] = {
...
@@ -262,7 +262,7 @@ const char *Process_fieldTitles[] = {
" CODE "
,
" DATA "
,
" LIB "
,
" DIRTY "
,
" UID "
,
"CPU% "
,
"MEM% "
,
" CODE "
,
" DATA "
,
" LIB "
,
" DIRTY "
,
" UID "
,
"CPU% "
,
"MEM% "
,
"USER "
,
" TIME+ "
,
"NLWP "
,
" TGID "
,
"USER "
,
" TIME+ "
,
"NLWP "
,
" TGID "
,
#ifdef HAVE_OPENVZ
#ifdef HAVE_OPENVZ
" CTID "
,
" VPID "
,
"
CTID "
,
" VPID "
,
#endif
#endif
#ifdef HAVE_VSERVER
#ifdef HAVE_VSERVER
" VXID "
,
" VXID "
,
...
@@ -295,6 +295,9 @@ void Process_getMaxPid() {
...
@@ -295,6 +295,9 @@ void Process_getMaxPid() {
if
(
maxPid
>
99999
)
{
if
(
maxPid
>
99999
)
{
Process_fieldTitles
[
PID
]
=
" PID "
;
Process_fieldTitles
[
PID
]
=
" PID "
;
Process_fieldTitles
[
PPID
]
=
" PPID "
;
Process_fieldTitles
[
PPID
]
=
" PPID "
;
#ifdef HAVE_OPENVZ
Process_fieldTitles
[
VPID
]
=
" VPID "
;
#endif
Process_fieldTitles
[
TPGID
]
=
" TPGID "
;
Process_fieldTitles
[
TPGID
]
=
" TPGID "
;
Process_fieldTitles
[
TGID
]
=
" TGID "
;
Process_fieldTitles
[
TGID
]
=
" TGID "
;
Process_fieldTitles
[
PGRP
]
=
" PGRP "
;
Process_fieldTitles
[
PGRP
]
=
" PGRP "
;
...
@@ -307,6 +310,9 @@ void Process_getMaxPid() {
...
@@ -307,6 +310,9 @@ void Process_getMaxPid() {
}
else
{
}
else
{
Process_fieldTitles
[
PID
]
=
" PID "
;
Process_fieldTitles
[
PID
]
=
" PID "
;
Process_fieldTitles
[
PPID
]
=
" PPID "
;
Process_fieldTitles
[
PPID
]
=
" PPID "
;
#ifdef HAVE_OPENVZ
Process_fieldTitles
[
VPID
]
=
" VPID "
;
#endif
Process_fieldTitles
[
TPGID
]
=
"TPGID "
;
Process_fieldTitles
[
TPGID
]
=
"TPGID "
;
Process_fieldTitles
[
TGID
]
=
" TGID "
;
Process_fieldTitles
[
TGID
]
=
" TGID "
;
Process_fieldTitles
[
PGRP
]
=
" PGRP "
;
Process_fieldTitles
[
PGRP
]
=
" PGRP "
;
...
@@ -593,8 +599,8 @@ static void Process_writeField(Process* this, RichString* str, ProcessField fiel
...
@@ -593,8 +599,8 @@ static void Process_writeField(Process* this, RichString* str, ProcessField fiel
}
}
case
STARTTIME
:
snprintf
(
buffer
,
n
,
"%s"
,
this
->
starttime_show
);
break
;
case
STARTTIME
:
snprintf
(
buffer
,
n
,
"%s"
,
this
->
starttime_show
);
break
;
#ifdef HAVE_OPENVZ
#ifdef HAVE_OPENVZ
case
CTID
:
snprintf
(
buffer
,
n
,
"%
5
u "
,
this
->
ctid
);
break
;
case
CTID
:
snprintf
(
buffer
,
n
,
"%
7
u "
,
this
->
ctid
);
break
;
case
VPID
:
snprintf
(
buffer
,
n
,
"%5u "
,
this
->
vpid
);
break
;
case
VPID
:
snprintf
(
buffer
,
n
,
Process_pidFormat
,
this
->
vpid
);
break
;
#endif
#endif
#ifdef HAVE_VSERVER
#ifdef HAVE_VSERVER
case
VXID
:
snprintf
(
buffer
,
n
,
"%5u "
,
this
->
vxid
);
break
;
case
VXID
:
snprintf
(
buffer
,
n
,
"%5u "
,
this
->
vxid
);
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment