Commit 70ed51a3 authored by Marc Kleine-Budde's avatar Marc Kleine-Budde Committed by Hisham Muhammad
Browse files

linux/LinuxProcessList: fix reading of number of read syscalls of process



The "if" tests if the character at index "5" is 'r', as a first quick
check. However at index "5" will always be a colon ":". This patch fixes
the off-by-one error. htop now shows proper values in the RD_SYSC
column.
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent df9922a6
......@@ -436,7 +436,7 @@ static void LinuxProcessList_readIoFile(LinuxProcess* process, const char* dirna
}
break;
case 's':
if (line[5] == 'r' && strncmp(line+1, "yscr: ", 6) == 0) {
if (line[4] == 'r' && strncmp(line+1, "yscr: ", 6) == 0) {
process->io_syscr = strtoull(line+7, NULL, 10);
} else if (strncmp(line+1, "yscw: ", 6) == 0) {
process->io_syscw = strtoull(line+7, NULL, 10);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment