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 /Process.c | |
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 'Process.c')
-rw-r--r-- | Process.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -335,7 +335,10 @@ void Process_outputRate(RichString* str, char* buffer, int n, double rate, int c largeNumberColor = CRT_colors[PROCESS]; processMegabytesColor = CRT_colors[PROCESS]; } - if (rate < ONE_K) { + if (rate == -1) { + int len = snprintf(buffer, n, " no perm "); + RichString_appendn(str, CRT_colors[PROCESS_SHADOW], buffer, len); + } else if (rate < ONE_K) { int len = snprintf(buffer, n, "%7.2f B/s ", rate); RichString_appendn(str, processColor, buffer, len); } else if (rate < ONE_K * ONE_K) { |