mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Catch invalid IO values due to no permissions.
Display them properly. Not fully convinced of the "no perm" message...
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user