Hide set_max_checkint_from_watchdog and its invocation completely behind ifdefs to avoid breaking compilation on non-systemd environments. Otherwise gcc bails out due to -Werror since it detects an unused parameter to the function. Signed-off-by: Anthony Iliopoulos <ailiop@xxxxxxxx> --- libmultipath/config.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libmultipath/config.c b/libmultipath/config.c index b4d87689eab3..658bec8b81c7 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c @@ -696,9 +696,9 @@ process_config_dir(struct config *conf, char *dir) pthread_cleanup_pop(1); } +#ifdef USE_SYSTEMD static void set_max_checkint_from_watchdog(struct config *conf) { -#ifdef USE_SYSTEMD char *envp = getenv("WATCHDOG_USEC"); unsigned long checkint; @@ -714,8 +714,8 @@ static void set_max_checkint_from_watchdog(struct config *conf) condlog(3, "enabling watchdog, interval %ld", checkint); conf->use_watchdog = true; } -#endif } +#endif struct config * load_config (char * file) @@ -789,7 +789,9 @@ load_config (char * file) /* * fill the voids left in the config file */ +#ifdef USE_SYSTEMD set_max_checkint_from_watchdog(conf); +#endif if (conf->max_checkint == 0) { if (conf->checkint == CHECKINT_UNDEF) conf->checkint = DEFAULT_CHECKINT; -- 2.28.0 -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel