diff options
author | Karel Zak | 2011-06-09 21:59:52 +0200 |
---|---|---|
committer | Karel Zak | 2011-06-09 21:59:52 +0200 |
commit | 2aefc0a8f267ddb57804755af9095d3cd5ceb0d7 (patch) | |
tree | 8601dca144fccbb9b6a895708868a520caccaddf /libmount/src/init.c | |
parent | build-sys: use top-level directory for libuuid rather than shlibs/uuid (diff) | |
download | kernel-qcow2-util-linux-2aefc0a8f267ddb57804755af9095d3cd5ceb0d7.tar.gz kernel-qcow2-util-linux-2aefc0a8f267ddb57804755af9095d3cd5ceb0d7.tar.xz kernel-qcow2-util-linux-2aefc0a8f267ddb57804755af9095d3cd5ceb0d7.zip |
build-sys: use top-level directory for libmount rather than shlibs/mount
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/init.c')
-rw-r--r-- | libmount/src/init.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/libmount/src/init.c b/libmount/src/init.c new file mode 100644 index 000000000..d80a2d8ca --- /dev/null +++ b/libmount/src/init.c @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2008 Karel Zak <kzak@redhat.com> + * + * This file may be redistributed under the terms of the + * GNU Lesser General Public License. + */ + +/** + * SECTION: init + * @title: Library initialization + * @short_description: initialize debuging + */ + +#include <stdlib.h> +#include <stdarg.h> + +#include "mountP.h" + +int libmount_debug_mask; + +/** + * mnt_init_debug: + * @mask: debug mask (0xffff to enable full debuging) + * + * If the @mask is not specified then this function reads + * LIBMOUNT_DEBUG environment variable to get the mask. + * + * Already initialized debugging stuff cannot be changed. It does not + * have effect to call this function twice. + */ +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; + + if (libmount_debug_mask) + printf("libmount: debug mask set to 0x%04x.\n", + libmount_debug_mask); + libmount_debug_mask |= MNT_DEBUG_INIT; +} |