From 39de73f5f1c15c8acc5285a0162b43888354e6aa Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 2 Apr 2013 22:26:12 +0200 Subject: libmount: add version and features to debug output Signed-off-by: Karel Zak --- libmount/src/init.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'libmount/src/init.c') diff --git a/libmount/src/init.c b/libmount/src/init.c index 58d4c1887..4e5f489c4 100644 --- a/libmount/src/init.c +++ b/libmount/src/init.c @@ -38,8 +38,21 @@ void mnt_init_debug(int mask) } else libmount_debug_mask = mask; - if (libmount_debug_mask) - fprintf(stderr, "libmount: debug mask set to 0x%04x.\n", - libmount_debug_mask); libmount_debug_mask |= MNT_DEBUG_INIT; + + if (libmount_debug_mask && 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); + + DBG(INIT, mnt_debug("library version: %s", ver)); + p = features; + while (p && *p) + DBG(INIT, mnt_debug(" feature: %s", *p++)); + } } -- cgit v1.2.3-55-g7522