aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2019-07-10 11:46:10 +0100
committerDaniel Lezcano <daniel.lezcano@linaro.org>2019-07-30 14:43:39 +0200
commit4fcc44628ece73277714521f2fc042d126c20e7d (patch)
tree6ee5d5d490dad3fa36eadbca5a997dc244a51034
parentbbf766fdcf397d97171aa0be3101a9c553b53d29 (diff)
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 <colin.king@canonical.com> Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
-rw-r--r--idlestat.h2
1 files changed, 1 insertions, 1 deletions
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;