From c12cec75b09a9dc8711d4323fda017a0b77f1105 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 27 Nov 2009 00:33:37 +0100 Subject: libmount: add debug support Signed-off-by: Karel Zak --- shlibs/mount/src/init.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 shlibs/mount/src/init.c (limited to 'shlibs/mount/src/init.c') diff --git a/shlibs/mount/src/init.c b/shlibs/mount/src/init.c new file mode 100644 index 000000000..33da47b5c --- /dev/null +++ b/shlibs/mount/src/init.c @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2008 Karel Zak + * + * This file may be redistributed under the terms of the + * GNU Lesser General Public License. + */ + +#include + +#include "mountP.h" + +#ifdef CONFIG_LIBMOUNT_DEBUG +int libmount_debug_mask; + +void mnt_init_debug(int mask) +{ + if (libmount_debug_mask & DEBUG_INIT) + return; + if (!mask) { + char *str = mnt_getenv_safe("LIBMOUNT_DEBUG"); + if (str) + libmount_debug_mask = strtoul(str, 0, 0); + } else + libmount_debug_mask = mask; + + if (libmount_debug_mask) + printf("libmount: debug mask set to 0x%04x.\n", + libmount_debug_mask); + libmount_debug_mask |= DEBUG_INIT; +} +#endif -- cgit v1.2.3-55-g7522