From 4fcc44628ece73277714521f2fc042d126c20e7d Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Wed, 10 Jul 2019 11:46:10 +0100 Subject: idlestat: fix -t with negative values Currently using a negative -t value will run forever because duration is an unsigned int and the check to see if it is negative is always true because an unsigned int can never be negative. Make duration a signed int to fix this. Signed-off-by: Colin Ian King Reviewed-by: Amit Kucheria Signed-off-by: Daniel Lezcano --- idlestat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idlestat.h b/idlestat.h index e030f6a..f06af24 100644 --- a/idlestat.h +++ b/idlestat.h @@ -132,7 +132,7 @@ struct trace_buffer_settings { struct program_options { int mode; int display; - unsigned int duration; + int duration; struct trace_buffer_settings tbs; char *filename; char *baseline_filename; -- cgit v1.2.3