diff mbox series

[1/3] libmultipath: don't print error message if WATCHDOG_USEC is 0

Message ID 20241114144224.248606-2-mwilck@suse.com (mailing list archive)
State New
Headers show
Series multipath-tools: fixes for systemd watchdog | expand

Commit Message

Martin Wilck Nov. 14, 2024, 2:42 p.m. UTC
WATCHDOG_USEC may be set to 0, which means that the watchdog
is disabled in systemd.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 libmultipath/config.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/libmultipath/config.c b/libmultipath/config.c
index 0e3a5cc..226ddec 100644
--- a/libmultipath/config.c
+++ b/libmultipath/config.c
@@ -865,6 +865,9 @@  static void set_max_checkint_from_watchdog(struct config *conf)
 	unsigned long checkint;
 
 	if (envp && sscanf(envp, "%lu", &checkint) == 1) {
+		if (checkint == 0)
+			/* watchdog disabled */
+			return;
 		/* Value is in microseconds */
 		checkint /= 1000000;
 		if (checkint < 1 || checkint > UINT_MAX) {