From f9ef8a010669e651d736e23a1dd76e124483677a Mon Sep 17 00:00:00 2001 From: Niklas Schnelle Date: Mon, 13 Apr 2026 13:52:37 +0200 Subject: [PATCH] util_time: zpcimon: Use a constant for seconds per day MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the magic value 86400 with a new util_time.h constant SEC_PER_DAY. Reviewed-by: Jan Höppner Signed-off-by: Niklas Schnelle Signed-off-by: Jan Höppner --- include/lib/util_time.h | 2 ++ zpcimon/zpcimon.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/lib/util_time.h b/include/lib/util_time.h index 42b9741a..21e2d78e 100644 --- a/include/lib/util_time.h +++ b/include/lib/util_time.h @@ -19,6 +19,8 @@ #define MSEC_PER_SEC 1000L +#define SEC_PER_DAY (24 * 60 * 60) + /** * Convert nanoseconds to microseconds * diff --git a/zpcimon/zpcimon.c b/zpcimon/zpcimon.c index 98a2871a..40b6edd7 100644 --- a/zpcimon/zpcimon.c +++ b/zpcimon/zpcimon.c @@ -24,6 +24,7 @@ #include "lib/util_opt.h" #include "lib/util_fmt.h" #include "lib/util_libc.h" +#include "lib/util_time.h" #include @@ -102,7 +103,7 @@ static void parse_cmdline(int argc, char *argv[], struct options *opts) optarg); exit(EXIT_FAILURE); } - if (seconds < 86400) + if (seconds < SEC_PER_DAY) opts->interval_seconds = seconds; if (seconds < 1) opts->interval_seconds = 1;