#include "mountP.h"
-int libmount_debug_mask;
+UL_DEBUG_DEFINE_MASK(libmount);
/**
* mnt_init_debug:
*/
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);
#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>
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, ...)
# 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