]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: add version and features to debug output
authorKarel Zak <kzak@redhat.com>
Tue, 2 Apr 2013 20:26:12 +0000 (22:26 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 2 Apr 2013 20:26:12 +0000 (22:26 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/init.c

index 58d4c1887869ccc6cc4df35e1c7b39bdf5d65570..4e5f489c4592fdcfd8ccbbab417ec029c0f85fe7 100644 (file)
@@ -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++));
+       }
 }