LinuxProcessList: fix misspelling

This commit is contained in:
Christian Göttsche 2020-11-25 12:49:17 +01:00
parent 601ad61e7d
commit c038326a70
1 changed files with 5 additions and 5 deletions

View File

@ -1010,7 +1010,7 @@ static bool LinuxProcessList_readCmdlineFile(Process* process, const char* dirna
tokenEnd = lastChar + 1; tokenEnd = lastChar + 1;
} }
lp->mergedCommand.maxLen = lastChar + 1; /* accomodate cmdline */ lp->mergedCommand.maxLen = lastChar + 1; /* accommodate cmdline */
if (!process->comm || strcmp(command, process->comm)) { if (!process->comm || strcmp(command, process->comm)) {
process->basenameOffset = tokenEnd; process->basenameOffset = tokenEnd;
setCommand(process, command, lastChar + 1); setCommand(process, command, lastChar + 1);
@ -1019,12 +1019,12 @@ static bool LinuxProcessList_readCmdlineFile(Process* process, const char* dirna
lp->mergedCommand.cmdlineChanged = true; lp->mergedCommand.cmdlineChanged = true;
} }
/* /proc/[pid]/comm could change, so should be udpated */ /* /proc/[pid]/comm could change, so should be updated */
xSnprintf(filename, MAX_NAME, "%s/%s/comm", dirname, name); xSnprintf(filename, MAX_NAME, "%s/%s/comm", dirname, name);
if ((fd = open(filename, O_RDONLY)) != -1 && if ((fd = open(filename, O_RDONLY)) != -1 &&
(amtRead = xread(fd, command, sizeof(command) - 1)) > 0) { (amtRead = xread(fd, command, sizeof(command) - 1)) > 0) {
command[amtRead - 1] = 0; command[amtRead - 1] = 0;
lp->mergedCommand.maxLen += amtRead - 1; /* accomodate comm */ lp->mergedCommand.maxLen += amtRead - 1; /* accommodate comm */
if (!lp->procComm || strcmp(command, lp->procComm)) { if (!lp->procComm || strcmp(command, lp->procComm)) {
free(lp->procComm); free(lp->procComm);
lp->procComm = xStrdup(command); lp->procComm = xStrdup(command);
@ -1039,11 +1039,11 @@ static bool LinuxProcessList_readCmdlineFile(Process* process, const char* dirna
if (fd != -1) if (fd != -1)
close(fd); close(fd);
/* execve could change /proc/[pid]/exe, so procExe should be udpated */ /* execve could change /proc/[pid]/exe, so procExe should be updated */
xSnprintf(command, sizeof(command), "%s/%s/exe", dirname, name); xSnprintf(command, sizeof(command), "%s/%s/exe", dirname, name);
if ((amtRead = readlink(command, filename, sizeof(filename) - 1)) > 0) { if ((amtRead = readlink(command, filename, sizeof(filename) - 1)) > 0) {
filename[amtRead] = 0; filename[amtRead] = 0;
lp->mergedCommand.maxLen += amtRead; /* accomodate exe */ lp->mergedCommand.maxLen += amtRead; /* accommodate exe */
if (!lp->procExe || strcmp(filename, lp->procExe)) { if (!lp->procExe || strcmp(filename, lp->procExe)) {
free(lp->procExe); free(lp->procExe);
lp->procExe = xStrdup(filename); lp->procExe = xStrdup(filename);