[libmultipath] pathcount(mpp, PATH_WILD) counts paths in any state
authorChristophe Varoqui <root@xa-s05.(none)>
Thu, 17 Nov 2005 16:38:31 +0000 (17:38 +0100)
committerChristophe Varoqui <root@xa-s05.(none)>
Thu, 17 Nov 2005 16:38:31 +0000 (17:38 +0100)
libcheckers/path_state.h
libmultipath/structs.c

index 08f3874..de31ecc 100644 (file)
@@ -1,3 +1,4 @@
+#define PATH_WILD      -1
 #define PATH_UNCHECKED 0
 #define PATH_DOWN      1
 #define PATH_UP                2
index 09be490..960d89b 100644 (file)
@@ -311,7 +311,7 @@ pathcount (struct multipath * mpp, int state)
 
        vector_foreach_slot (mpp->pg, pgp, i)
                vector_foreach_slot (pgp->paths, pp, j)
-                       if (pp->state == state)
+                       if ((pp->state == state) || (state == PATH_WILD))
                                count++;
 
        return count;