mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Rename command line field from comm to cmdline
This commit is contained in:
@ -110,7 +110,7 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
|
||||
static const char* LinuxProcess_getCommandStr(const Process *this) {
|
||||
const LinuxProcess *lp = (const LinuxProcess *)this;
|
||||
if ((Process_isUserlandThread(this) && this->settings->showThreadNames) || !lp->mergedCommand.str) {
|
||||
return this->comm;
|
||||
return this->cmdline;
|
||||
}
|
||||
return lp->mergedCommand.str;
|
||||
}
|
||||
@ -386,7 +386,7 @@ void LinuxProcess_makeCommandStr(Process* this) {
|
||||
const int delAttr = CRT_colors[FAILED_READ];
|
||||
|
||||
/* Establish some shortcuts to data we need */
|
||||
const char *cmdline = this->comm;
|
||||
const char *cmdline = this->cmdline;
|
||||
const char *procExe = lp->procExe;
|
||||
const char *procComm = lp->procComm;
|
||||
|
||||
|
@ -1132,9 +1132,9 @@ static bool LinuxProcessList_readCmdlineFile(Process* process, openat_arg_t proc
|
||||
|
||||
LinuxProcess *lp = (LinuxProcess *)process;
|
||||
lp->mergedCommand.maxLen = lastChar + 1; /* accommodate cmdline */
|
||||
if (!process->comm || !String_eq(command, process->comm)) {
|
||||
if (!process->cmdline || !String_eq(command, process->cmdline)) {
|
||||
process->basenameOffset = tokenEnd;
|
||||
free_and_xStrdup(&process->comm, command);
|
||||
free_and_xStrdup(&process->cmdline, command);
|
||||
lp->procCmdlineBasenameOffset = tokenStart;
|
||||
lp->procCmdlineBasenameEnd = tokenEnd;
|
||||
lp->mergedCommand.cmdlineChanged = true;
|
||||
@ -1458,14 +1458,14 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, openat_arg_
|
||||
|
||||
if (proc->state == 'Z' && (proc->basenameOffset == 0)) {
|
||||
proc->basenameOffset = -1;
|
||||
free_and_xStrdup(&proc->comm, command);
|
||||
free_and_xStrdup(&proc->cmdline, command);
|
||||
lp->procCmdlineBasenameOffset = 0;
|
||||
lp->procCmdlineBasenameEnd = 0;
|
||||
lp->mergedCommand.commChanged = true;
|
||||
} else if (Process_isThread(proc)) {
|
||||
if (settings->showThreadNames || Process_isKernelThread(proc)) {
|
||||
proc->basenameOffset = -1;
|
||||
free_and_xStrdup(&proc->comm, command);
|
||||
free_and_xStrdup(&proc->cmdline, command);
|
||||
lp->procCmdlineBasenameOffset = 0;
|
||||
lp->procCmdlineBasenameEnd = 0;
|
||||
lp->mergedCommand.commChanged = true;
|
||||
|
Reference in New Issue
Block a user