diff options
author | Benny Baumann <BenBE@geshi.org> | 2020-11-23 22:55:56 +0100 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2020-11-24 19:05:48 +0100 |
commit | 21e3063e2edec4f7cbcf9188aa85ac20cd082939 (patch) | |
tree | 4a23fd0f9043bf4c5958ec396820f17f41f03646 /linux/LinuxProcessList.c | |
parent | ec36c5ccf8560028bf274bd4b0ce54969681dbc5 (diff) |
Include comm before cmdline if exe could not be read, but comm mismatches basename from cmdline
Also highlights entries where exe was marked deleted
Diffstat (limited to 'linux/LinuxProcessList.c')
-rw-r--r-- | linux/LinuxProcessList.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index 43c419a9..4c6a8f23 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -1051,12 +1051,22 @@ static bool LinuxProcessList_readCmdlineFile(Process* process, const char* dirna ; lp->procExeBasenameOffset = amtRead + 1; lp->mergedCommand.exeChanged = true; + + const char* deletedMarker = " (deleted)"; + if (strlen(lp->procExe) > strlen(deletedMarker)) { + lp->procExeDeleted = String_eq(lp->procExe + strlen(lp->procExe) - strlen(deletedMarker), deletedMarker); + + if (lp->procExeDeleted && strlen(lp->procExe) - strlen(deletedMarker) == 1 && lp->procExe[0] == '/') { + lp->procExeBasenameOffset = 0; + } + } } } else if (lp->procExe) { free(lp->procExe); lp->procExe = NULL; lp->procExeLen = 0; lp->procExeBasenameOffset = 0; + lp->procExeDeleted = false; lp->mergedCommand.exeChanged = true; } |