WATCHDOG_USEC may be set to 0, which means that the watchdog
is disabled in systemd.

Signed-off-by: Martin Wilck <[email protected]>
---
 libmultipath/config.c | 3 +++
 1 file changed, 3 insertions(+)

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) {
-- 
2.47.0


Reply via email to