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
97ea7a1a
Commit
97ea7a1a
authored
Nov 08, 2006
by
Hisham Muhammad
Browse files
Ok, second take on fixing the handling of comm.-
parent
adbfe82e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Process.c
View file @
97ea7a1a
...
...
@@ -140,6 +140,7 @@ Process* Process_new(struct ProcessList_ *pl) {
Process
*
Process_clone
(
Process
*
this
)
{
Process
*
clone
=
malloc
(
sizeof
(
Process
));
memcpy
(
clone
,
this
,
sizeof
(
Process
));
this
->
comm
=
NULL
;
return
clone
;
}
...
...
ProcessList.c
View file @
97ea7a1a
...
...
@@ -526,10 +526,7 @@ void ProcessList_processEntries(ProcessList* this, char* dirname, int parent, fl
assert
(
process
->
pid
==
pid
);
}
else
{
process
=
prototype
;
if
(
process
->
comm
)
{
free
(
process
->
comm
);
process
->
comm
=
NULL
;
}
assert
(
process
->
comm
==
NULL
);
process
->
pid
=
pid
;
if
(
!
ProcessList_readStatusFile
(
this
,
process
,
dirname
,
name
))
goto
errorReadingProcess
;
...
...
@@ -611,6 +608,10 @@ void ProcessList_processEntries(ProcessList* this, char* dirname, int parent, fl
errorReadingProcess:
{
if
(
existingProcess
)
ProcessList_remove
(
this
,
process
);
if
(
process
->
comm
)
{
free
(
process
->
comm
);
process
->
comm
=
NULL
;
}
}
}
}
...
...
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