From 797bcd096181e201dcedd097abc72d0191da4879 Mon Sep 17 00:00:00 2001 From: Hisham Date: Sat, 20 Feb 2016 02:22:57 -0200 Subject: Catch invalid IO values due to no permissions. Display them properly. Not fully convinced of the "no perm" message... --- Process.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Process.c') diff --git a/Process.c b/Process.c index 07ecba15..dddd7fcd 100644 --- a/Process.c +++ b/Process.c @@ -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) { -- cgit v1.2.3