diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2018-02-07 23:16:37 +0100 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-02-17 16:14:34 -0200 |
commit | 70ed51a303870952178b4acf11fd1954e2665127 (patch) | |
tree | f5c42c8f1fc01c09d8c00bfef057fe0c81ba439d | |
parent | df9922a67eb8e02ab4cf1ff8f24b40f14094e699 (diff) |
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: Marc Kleine-Budde <mkl@pengutronix.de>
-rw-r--r-- | linux/LinuxProcessList.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index 6f2631af..23077025 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -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); |