mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-26 07:45:45 +00:00
Remove duplicate field LinuxProcess->procCmdlineBasenameEnd
This field held practically the same value as cmdlineBasenameEnd
This commit is contained in:
parent
a685661866
commit
6dc485dd20
@ -392,7 +392,7 @@ void LinuxProcess_makeCommandStr(Process* this) {
|
||||
char *str = strStart;
|
||||
|
||||
int cmdlineBasenameOffset = lp->procCmdlineBasenameOffset;
|
||||
int cmdlineBasenameEnd = lp->procCmdlineBasenameEnd;
|
||||
int cmdlineBasenameEnd = this->cmdlineBasenameOffset;
|
||||
|
||||
if (!cmdline) {
|
||||
cmdlineBasenameOffset = 0;
|
||||
|
@ -64,7 +64,6 @@ typedef struct LinuxProcessMergedCommand_ {
|
||||
typedef struct LinuxProcess_ {
|
||||
Process super;
|
||||
int procCmdlineBasenameOffset;
|
||||
int procCmdlineBasenameEnd;
|
||||
LinuxProcessMergedCommand mergedCommand;
|
||||
bool isKernelThread;
|
||||
IOPriority ioPriority;
|
||||
|
@ -1133,10 +1133,9 @@ static bool LinuxProcessList_readCmdlineFile(Process* process, openat_arg_t proc
|
||||
LinuxProcess *lp = (LinuxProcess *)process;
|
||||
lp->mergedCommand.maxLen = lastChar + 1; /* accommodate cmdline */
|
||||
if (!process->cmdline || !String_eq(command, process->cmdline)) {
|
||||
process->cmdlineBasenameOffset = tokenEnd;
|
||||
free_and_xStrdup(&process->cmdline, command);
|
||||
lp->procCmdlineBasenameOffset = tokenStart;
|
||||
lp->procCmdlineBasenameEnd = tokenEnd;
|
||||
process->cmdlineBasenameOffset = tokenEnd;
|
||||
lp->mergedCommand.cmdlineChanged = true;
|
||||
}
|
||||
|
||||
@ -1465,14 +1464,12 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, openat_arg_
|
||||
proc->cmdlineBasenameOffset = -1;
|
||||
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->cmdlineBasenameOffset = -1;
|
||||
free_and_xStrdup(&proc->cmdline, command);
|
||||
lp->procCmdlineBasenameOffset = 0;
|
||||
lp->procCmdlineBasenameEnd = 0;
|
||||
lp->mergedCommand.commChanged = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user