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
e3f65c8e
Commit
e3f65c8e
authored
Sep 14, 2017
by
Hisham Muhammad
Browse files
Make 'c' key work with threads as well.
parent
b9934ffa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Action.c
View file @
e3f65c8e
...
...
@@ -142,7 +142,7 @@ static void tagAllChildren(Panel* panel, Process* parent) {
pid_t
ppid
=
parent
->
pid
;
for
(
int
i
=
0
;
i
<
Panel_size
(
panel
);
i
++
)
{
Process
*
p
=
(
Process
*
)
Panel_get
(
panel
,
i
);
if
(
!
p
->
tag
&&
p
->
ppid
==
ppid
)
{
if
(
!
p
->
tag
&&
Process_isChildOf
(
p
,
ppid
)
)
{
tagAllChildren
(
panel
,
p
);
}
}
...
...
Process.c
View file @
e3f65c8e
...
...
@@ -172,6 +172,8 @@ typedef struct ProcessClass_ {
#define As_Process(this_) ((ProcessClass*)((this_)->super.klass))
#define Process_isChildOf(process_, pid_) (process_->tgid == pid_ || (process_->tgid == process_->pid && process_->ppid == pid_))
}*/
static
int
Process_getuid
=
-
1
;
...
...
Process.h
View file @
e3f65c8e
...
...
@@ -151,6 +151,8 @@ typedef struct ProcessClass_ {
#define As_Process(this_) ((ProcessClass*)((this_)->super.klass))
#define Process_isChildOf(process_, pid_) (process_->tgid == pid_ || (process_->tgid == process_->pid && process_->ppid == pid_))
#define ONE_K 1024L
#define ONE_M (ONE_K * ONE_K)
...
...
ProcessList.c
View file @
e3f65c8e
...
...
@@ -173,7 +173,7 @@ static void ProcessList_buildTree(ProcessList* this, pid_t pid, int level, int i
for
(
int
i
=
Vector_size
(
this
->
processes
)
-
1
;
i
>=
0
;
i
--
)
{
Process
*
process
=
(
Process
*
)
(
Vector_get
(
this
->
processes
,
i
));
if
(
process
->
show
&&
(
p
rocess
->
tgid
==
pid
||
(
process
->
tgid
==
process
->
pid
&&
process
->
ppid
==
pid
))
)
{
if
(
process
->
show
&&
P
rocess
_isChildOf
(
process
,
pid
))
{
process
=
(
Process
*
)
(
Vector_take
(
this
->
processes
,
i
));
Vector_add
(
children
,
process
);
}
...
...
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