Call makeCommandStr on all platforms

This commit is contained in:
Benny Baumann
2021-04-18 18:10:04 +02:00
committed by BenBE
parent bcb18ef822
commit a61a2e6d47
9 changed files with 28 additions and 11 deletions

View File

@ -388,6 +388,17 @@ void Process_makeCommandStr(Process *this) {
bool searchCommInCmdline = settings->findCommInCmdline;
bool stripExeFromCmdline = settings->stripExeFromCmdline;
/* Nothing to do to (Re)Generate the Command string, if the process is:
* - a kernel thread, or
* - a zombie from before being under htop's watch, or
* - a user thread and showThreadNames is not set */
if (Process_isKernelThread(this))
return;
if (this->state == 'Z' && !this->mergedCommand.str)
return;
if (Process_isUserlandThread(this) && settings->showThreadNames)
return;
/* this->mergedCommand.str needs updating only if its state or contents changed.
* Its content is based on the fields cmdline, comm, and exe. */
if (