[dm-devel] [PATCH 6/6] Always put watchdog in the config structure

Benjamin Marzinski bmarzins at redhat.com
Fri Sep 12 17:44:52 UTC 2014


Only multipathd and libmultipath ever get compiled with USE_SYSTEMD
enabled. If the watchdog variable is only in the config structure when
USE_SYSTEMD is enabled, it means that the multipath and libmultipath
code have different views of the config structure. This causes all sorts
of errors when multipath calls a libmultipath function.

The other alternative would be to leave the preprocessor #ifdef and
make sure to compile all tools with

CFLAGS += -DUSE_SYSTEMD=$(SYSTEMD)

Removing the #ifdef in the config structure means we don't have to worry
about this mistake happening again in the future, and only takes up 8
extra bytes in the structure.

Signed-off-by: Benjamin Marzinski <bmarzins at redhat.com>
---
 libmultipath/config.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/libmultipath/config.h b/libmultipath/config.h
index 2097879..5b6d107 100644
--- a/libmultipath/config.h
+++ b/libmultipath/config.h
@@ -110,9 +110,7 @@ struct config {
 	int ignore_wwids;
 	int checker_timeout;
 	int daemon;
-#ifdef USE_SYSTEMD
 	int watchdog;
-#endif
 	int flush_on_last_del;
 	int attribute_flags;
 	int fast_io_fail;
-- 
1.8.3.1




More information about the dm-devel mailing list