diff options
author | Karel Zak | 2009-11-27 00:33:37 +0100 |
---|---|---|
committer | Karel Zak | 2010-06-03 15:20:10 +0200 |
commit | c12cec75b09a9dc8711d4323fda017a0b77f1105 (patch) | |
tree | de503fcb48bbcc8b80c12b6a386331304e1fe216 /shlibs/mount/src/init.c | |
parent | libmount: add basic utils (diff) | |
download | kernel-qcow2-util-linux-c12cec75b09a9dc8711d4323fda017a0b77f1105.tar.gz kernel-qcow2-util-linux-c12cec75b09a9dc8711d4323fda017a0b77f1105.tar.xz kernel-qcow2-util-linux-c12cec75b09a9dc8711d4323fda017a0b77f1105.zip |
libmount: add debug support
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/init.c')
-rw-r--r-- | shlibs/mount/src/init.c | 31 |
1 files changed, 31 insertions, 0 deletions
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 <kzak@redhat.com> + * + * This file may be redistributed under the terms of the + * GNU Lesser General Public License. + */ + +#include <stdlib.h> + +#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 |