]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: use macros from include/debug.h
authorOndrej Oprala <ooprala@redhat.com>
Wed, 12 Mar 2014 13:37:58 +0000 (14:37 +0100)
committerOndrej Oprala <ooprala@redhat.com>
Wed, 12 Mar 2014 13:37:58 +0000 (14:37 +0100)
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
libmount/src/mountP.h
libmount/src/test.c

index a580ae4388095ed242baabf8eba44f90afde59a3..6b20f8ff09d4c837a86b979f85279e832b9dc2df 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "c.h"
 #include "list.h"
+#include "debug.h"
 #include "libmount.h"
 
 /* features */
@@ -56,6 +57,9 @@
 # include <stdio.h>
 # include <stdarg.h>
 
+#define DBG(m, x) do { __UL_DBG(libmount, MNT_DEBUG_, m, x); } while (0)
+#define INIT_DBG(m) do { __UL_INIT_DEBUG(libmount, MNT_DEBUG_, m, LIBMOUNT_DEBUG); } while (0)
+
 # define WARN_REFCOUNT(m, o, r) \
                        do { \
                                if ((MNT_DEBUG_ ## m) & libmount_debug_mask && r != 0) \
                                } \
                        } while (0)
 
-# define DBG(m, x)     do { \
-                               if ((MNT_DEBUG_ ## m) & libmount_debug_mask) { \
-                                       fprintf(stderr, "%d: libmount: %8s: ", getpid(), # m); \
-                                       x; \
-                               } \
-                       } while (0)
-
 # define DBG_FLUSH     do { \
                                if (libmount_debug_mask && \
                                    libmount_debug_mask != MNT_DEBUG_INIT) \
index 2da00b40d673f8a9fb009f1f2f0d75ce4c9e255b..40c344fc24a503a2aa938b360ecccb50cea6d961 100644 (file)
@@ -31,7 +31,7 @@ int mnt_run_test(struct libmnt_test *tests, int argc, char *argv[])
            strcmp(argv[1], "-h") == 0)
                goto usage;
 
-       mnt_init_debug(0);
+       INIT_DBG(0);
 
        for (ts = tests; ts->name; ts++) {
                if (strcmp(ts->name, argv[1]) == 0) {