mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
Linux: always compute procExeDeleted if already set
A process, whose executable has been replaced and thus marked by htop, can be re-executed with the replaced executable, with the same PID, in two ways: the Linux feature checkpoint/restore or re-execution of PID 1. The actual check is just a string comparison, like the dropped condition, leading to (almost) no computation overhead.
This commit is contained in:
parent
9f4a4faab9
commit
754c0d6bb9
@ -1236,8 +1236,8 @@ static bool LinuxProcessList_readCmdlineFile(Process* process, openat_arg_t proc
|
||||
if (amtRead > 0) {
|
||||
filename[amtRead] = 0;
|
||||
if (!process->procExe ||
|
||||
(!process->procExeDeleted && !String_eq(filename, process->procExe)) ||
|
||||
(process->procExeDeleted && !String_startsWith(filename, process->procExe))) {
|
||||
(!process->procExeDeleted && !String_eq(filename, process->procExe)) ||
|
||||
process->procExeDeleted) {
|
||||
|
||||
const char* deletedMarker = " (deleted)";
|
||||
const size_t markerLen = strlen(deletedMarker);
|
||||
|
Loading…
Reference in New Issue
Block a user