diff options
author | Ondrej Oprala | 2014-03-13 10:53:16 +0100 |
---|---|---|
committer | Ondrej Oprala | 2014-03-13 11:03:23 +0100 |
commit | d73658219925fb5a8ef55e6408ba3ea5c4688a58 (patch) | |
tree | 3ce6170bc66038913f7accf0e7bd13e5c280c3cf | |
parent | libcommon: don't mention lib versions in debug macros (diff) | |
download | kernel-qcow2-util-linux-d73658219925fb5a8ef55e6408ba3ea5c4688a58.tar.gz kernel-qcow2-util-linux-d73658219925fb5a8ef55e6408ba3ea5c4688a58.tar.xz kernel-qcow2-util-linux-d73658219925fb5a8ef55e6408ba3ea5c4688a58.zip |
libmount: further debug.h integration
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
-rw-r--r-- | libmount/src/init.c | 16 | ||||
-rw-r--r-- | libmount/src/mountP.h | 5 |
2 files changed, 6 insertions, 15 deletions
diff --git a/libmount/src/init.c b/libmount/src/init.c index a14637d75..19278bb89 100644 --- a/libmount/src/init.c +++ b/libmount/src/init.c @@ -15,7 +15,7 @@ #include "mountP.h" -int libmount_debug_mask; +UL_DEBUG_DEFINE_MASK(libmount); /** * mnt_init_debug: @@ -29,24 +29,12 @@ int libmount_debug_mask; */ void mnt_init_debug(int mask) { - if (libmount_debug_mask & MNT_DEBUG_INIT) - return; - if (!mask) { - char *str = getenv("LIBMOUNT_DEBUG"); - if (str) - libmount_debug_mask = strtoul(str, 0, 0); - } else - libmount_debug_mask = mask; - - libmount_debug_mask |= MNT_DEBUG_INIT; + INIT_DBG(mask); if (libmount_debug_mask != MNT_DEBUG_INIT) { const char *ver = NULL; const char **features = NULL, **p; - DBG(INIT, mnt_debug("library debug mask: 0x%04x", - libmount_debug_mask)); - mnt_get_library_version(&ver); mnt_get_library_features(&features); diff --git a/libmount/src/mountP.h b/libmount/src/mountP.h index 6b20f8ff0..1081c0d2f 100644 --- a/libmount/src/mountP.h +++ b/libmount/src/mountP.h @@ -53,6 +53,8 @@ #define MNT_DEBUG_DIFF (1 << 11) #define MNT_DEBUG_ALL 0xFFFF +#define MNT_DEF_FLAG(m) UL_DEFINE_FLAG(MNT_DEBUG_, m) + #ifdef CONFIG_LIBMOUNT_DEBUG # include <stdio.h> # include <stdarg.h> @@ -79,7 +81,7 @@ fflush(stderr); \ } while(0) -extern int libmount_debug_mask; +UL_DEBUG_DECLARE_MASK(libmount); static inline void __attribute__ ((__format__ (__printf__, 1, 2))) mnt_debug(const char *mesg, ...) @@ -108,6 +110,7 @@ mnt_debug_h(void *handler, const char *mesg, ...) # define WARN_REFCOUNT(m,o,r) do { ; } while (0) # define ON_DBG(m,x) do { ; } while (0) # define DBG(m,x) do { ; } while (0) +# define INIT_DBG(m,x) do { ; } while (0) # define DBG_FLUSH do { ; } while(0) #endif |