diff options
author | Benny Baumann <BenBE@geshi.org> | 2021-02-01 22:37:41 +0100 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2021-05-23 09:22:21 +0200 |
commit | 93a44acf7e4b0a909fbd717da8a3999c46924c3d (patch) | |
tree | 62bb31c254d02501342bf5ab80f525ef19ad4ed8 /linux | |
parent | b839987df7f6fc761c96b651a3dfc49eb13e879a (diff) |
Move procExeDeleted flag to main Process structure
Diffstat (limited to 'linux')
-rw-r--r-- | linux/LinuxProcess.c | 6 | ||||
-rw-r--r-- | linux/LinuxProcess.h | 1 | ||||
-rw-r--r-- | linux/LinuxProcessList.c | 6 |
3 files changed, 6 insertions, 7 deletions
diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c index f8b48b25..bc160186 100644 --- a/linux/LinuxProcess.c +++ b/linux/LinuxProcess.c @@ -441,14 +441,14 @@ void LinuxProcess_makeCommandStr(Process* this) { if (haveCommInExe) WRITE_HIGHLIGHT(exeBasenameOffset, exeBasenameLen, commAttr, CMDLINE_HIGHLIGHT_FLAG_COMM); WRITE_HIGHLIGHT(exeBasenameOffset, exeBasenameLen, baseAttr, CMDLINE_HIGHLIGHT_FLAG_BASENAME); - if (lp->procExeDeleted) + if (this->procExeDeleted) WRITE_HIGHLIGHT(exeBasenameOffset, exeBasenameLen, delAttr, CMDLINE_HIGHLIGHT_FLAG_DELETED); str = stpcpy(str, procExe); } else { if (haveCommInExe) WRITE_HIGHLIGHT(0, exeBasenameLen, commAttr, CMDLINE_HIGHLIGHT_FLAG_COMM); WRITE_HIGHLIGHT(0, exeBasenameLen, baseAttr, CMDLINE_HIGHLIGHT_FLAG_BASENAME); - if (lp->procExeDeleted) + if (this->procExeDeleted) WRITE_HIGHLIGHT(0, exeBasenameLen, delAttr, CMDLINE_HIGHLIGHT_FLAG_DELETED); str = stpcpy(str, procExe + exeBasenameOffset); } @@ -698,7 +698,7 @@ static void LinuxProcess_writeField(const Process* this, RichString* str, Proces const char* procExe; if (this->procExe) { attr = CRT_colors[Process_isUserlandThread(this) ? PROCESS_THREAD_BASENAME : PROCESS_BASENAME]; - if (lp->procExeDeleted) + if (this->procExeDeleted) attr = CRT_colors[FAILED_READ]; procExe = this->procExe + lp->procExeBasenameOffset; } else { diff --git a/linux/LinuxProcess.h b/linux/LinuxProcess.h index 9d5cfc4c..a39b8408 100644 --- a/linux/LinuxProcess.h +++ b/linux/LinuxProcess.h @@ -65,7 +65,6 @@ typedef struct LinuxProcess_ { Process super; int procExeLen; int procExeBasenameOffset; - bool procExeDeleted; int procCmdlineBasenameOffset; int procCmdlineBasenameEnd; LinuxProcessMergedCommand mergedCommand; diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index a55bada7..dfe14dde 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -1178,9 +1178,9 @@ static bool LinuxProcessList_readCmdlineFile(Process* process, openat_arg_t proc const char* deletedMarker = " (deleted)"; if (strlen(process->procExe) > strlen(deletedMarker)) { - lp->procExeDeleted = String_eq(process->procExe + strlen(process->procExe) - strlen(deletedMarker), deletedMarker); + process->procExeDeleted = String_eq(process->procExe + strlen(process->procExe) - strlen(deletedMarker), deletedMarker); - if (lp->procExeDeleted && strlen(process->procExe) - strlen(deletedMarker) == 1 && process->procExe[0] == '/') { + if (process->procExeDeleted && strlen(process->procExe) - strlen(deletedMarker) == 1 && process->procExe[0] == '/') { lp->procExeBasenameOffset = 0; } } @@ -1190,7 +1190,7 @@ static bool LinuxProcessList_readCmdlineFile(Process* process, openat_arg_t proc process->procExe = NULL; lp->procExeLen = 0; lp->procExeBasenameOffset = 0; - lp->procExeDeleted = false; + process->procExeDeleted = false; lp->mergedCommand.exeChanged = true; } |