From 260f38d23c986b917184bf2379c04cc630bd0a17 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Sat, 25 Apr 2020 09:35:38 +0200 Subject: [PATCH] sar: Don't check if we are close enough to selected interval when interval=1 Signed-off-by: Sebastien GODARD --- sa_common.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sa_common.c b/sa_common.c index a38dfd6..0c1d9e2 100644 --- a/sa_common.c +++ b/sa_common.c @@ -614,7 +614,7 @@ char *get_devname(unsigned int major, unsigned int minor, int pretty) * @interval Interval of time. * * RETURNS: - * 1 if we are actually close enough to desired interval, 0 otherwise. + * TRUE if we are actually close enough to desired interval, FALSE otherwise. *************************************************************************** */ int next_slice(unsigned long long uptime_ref, unsigned long long uptime, @@ -639,6 +639,10 @@ int next_slice(unsigned long long uptime_ref, unsigned long long uptime, last_uptime = uptime; + if (interval == 1) + /* Smallest time interval: Always close enough to desired interval */ + return TRUE; + /* * A few notes about the "algorithm" used here to display selected entries * from the system activity file (option -f with -i flag): -- 2.40.0