diff options
author | Hisham <hisham@gobolinux.org> | 2016-02-20 02:22:57 -0200 |
---|---|---|
committer | Hisham <hisham@gobolinux.org> | 2016-02-20 02:23:26 -0200 |
commit | 797bcd096181e201dcedd097abc72d0191da4879 (patch) | |
tree | 08b0688c9b28ae9d1dde6e5e39a2b19d6131c449 /linux | |
parent | baec4bdcb083eb76259737bb7e83323373a1d910 (diff) |
Catch invalid IO values due to no permissions.
Display them properly. Not fully convinced of the "no perm" message...
Diffstat (limited to 'linux')
-rw-r--r-- | linux/LinuxProcess.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c index 17790f65..43b5e38f 100644 --- a/linux/LinuxProcess.c +++ b/linux/LinuxProcess.c @@ -313,7 +313,12 @@ void LinuxProcess_writeField(Process* this, RichString* str, ProcessField field) case CNCLWB: Process_colorNumber(str, lp->io_cancelled_write_bytes, coloring); return; case IO_READ_RATE: Process_outputRate(str, buffer, n, lp->io_rate_read_bps, coloring); return; case IO_WRITE_RATE: Process_outputRate(str, buffer, n, lp->io_rate_write_bps, coloring); return; - case IO_RATE: Process_outputRate(str, buffer, n, lp->io_rate_read_bps + lp->io_rate_write_bps, coloring); return; + case IO_RATE: { + double totalRate = (lp->io_rate_read_bps != -1) + ? (lp->io_rate_read_bps + lp->io_rate_write_bps) + : -1; + Process_outputRate(str, buffer, n, totalRate, coloring); return; + } #endif #ifdef HAVE_OPENVZ case CTID: snprintf(buffer, n, "%7u ", lp->ctid); break; |