From 51b679604b4d5269b43e4c3fe3e9c3f43463c744 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Sat, 27 Apr 2019 14:46:53 +0200 Subject: [PATCH] sar: Allow option -i when no input file is specified Option -i can be used if no datafile is specified by the user (e.g. a syntax like "sar -i 600" should not display an error). Signed-off-by: Sebastien GODARD --- sar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sar.c b/sar.c index 495a83b..5bf54e1 100644 --- a/sar.c +++ b/sar.c @@ -1472,7 +1472,7 @@ int main(int argc, char **argv) /* 'sar' is equivalent to 'sar -f' */ if ((argc == 1) || - ((interval < 0) && !from_file[0] && !to_file[0])) { + (((interval < 0) || INTERVAL_SET(flags)) && !from_file[0] && !to_file[0])) { set_default_file(from_file, day_offset, -1); } -- 2.40.0