util_time: zpcimon: Use a constant for seconds per day

Replace the magic value 86400 with a new util_time.h constant
SEC_PER_DAY.

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Niklas Schnelle
2026-04-13 13:52:37 +02:00
committed by Jan Höppner
parent 2c63c69af4
commit f9ef8a0106
2 changed files with 4 additions and 1 deletions

View File

@@ -19,6 +19,8 @@
#define MSEC_PER_SEC 1000L
#define SEC_PER_DAY (24 * 60 * 60)
/**
* Convert nanoseconds to microseconds
*

View File

@@ -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 <openssl/evp.h>
@@ -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;