[libmultipath] condlog() not to enqueue uneeded logs
authorroot <root@xa-s05.(none)>
Fri, 22 Jul 2005 08:07:55 +0000 (10:07 +0200)
committerroot <root@xa-s05.(none)>
Fri, 22 Jul 2005 08:07:55 +0000 (10:07 +0200)
Message enqueueing didn't check for verbosity level.
Corrected.

libmultipath/debug.c
multipathd/Makefile

index aae82fd9172b856924fb9c3b152a0a4c5393655d..7bb7d2d2f9f3e03daa36086b7c9868a5c5a6623e 100644 (file)
@@ -14,22 +14,17 @@ void dlog (int sink, int prio, char * fmt, ...)
        int thres;
 
        va_start(ap, fmt);
+       thres = (conf) ? conf->verbosity : 0;
 
-       if (!sink) {
-               if (!conf)
-                       thres = 0;
-               else
-                       thres = conf->verbosity;
-
-               if (prio <= thres) {
+       if (prio <= thres) {
+               if (!sink) {
                        vfprintf(stdout, fmt, ap);
                        fprintf(stdout, "\n");
                }
-       }
 #if DAEMON
-       else {
-               log_safe(prio + 3, fmt, ap);
-       }
+               else
+                       log_safe(prio + 3, fmt, ap);
 #endif
+       }
        va_end(ap);
 }
index a42b459a6beeae5946541ba9f5cbd8c2e7fff522..bd2f4f6926b1cb45552c4ae635633587f966292c 100644 (file)
@@ -22,6 +22,7 @@ LDFLAGS = -lpthread -ldevmapper -lsysfs -lreadline -lcurses
 #
 #CFLAGS += -DLCKDBG
 #CFLAGS += -D_DEBUG_
+#CFLAGS += -DLOGDBG
 
 #
 # object files