+2005-06-27 Theodore Ts'o <tytso@mit.edu>
+
+ * read.c, dev.c: Fix the debugging/TEST_PROGRAM code so that it is
+ sufficiently standalone that "make check" will compile
+ without errors even when configure "--enable-blkid-debug"
+ is not specified.
+
2005-05-07 Theodore Ts'o <tytso@mit.edu>
* tag.c (blkid_find_dev_with_tag): If a device can't be found with
list_for_each(p, &dev->bid_tags) {
blkid_tag tag = list_entry(p, struct blkid_struct_tag, bit_tags);
- blkid_debug_dump_tag(tag);
+ if (tag)
+ printf(" tag: %s=\"%s\"\n", tag->bit_name,
+ tag->bit_val);
+ else
+ printf(" tag: NULL\n");
}
printf("\n");
}
#include <stdlib.h>
#endif
+#ifdef TEST_PROGRAM
+#define blkid_debug_dump_dev(dev) (debug_dump_dev(dev))
+static void debug_dump_dev(blkid_dev dev);
+#endif
+
/*
* File format:
*
}
#ifdef TEST_PROGRAM
+static void debug_dump_dev(blkid_dev dev)
+{
+ struct list_head *p;
+
+ if (!dev) {
+ printf(" dev: NULL\n");
+ return;
+ }
+
+ printf(" dev: name = %s\n", dev->bid_name);
+ printf(" dev: DEVNO=\"0x%0llx\"\n", dev->bid_devno);
+ printf(" dev: TIME=\"%lu\"\n", dev->bid_time);
+ printf(" dev: PRI=\"%d\"\n", dev->bid_pri);
+ printf(" dev: flags = 0x%08X\n", dev->bid_flags);
+
+ list_for_each(p, &dev->bid_tags) {
+ blkid_tag tag = list_entry(p, struct blkid_struct_tag, bit_tags);
+ if (tag)
+ printf(" tag: %s=\"%s\"\n", tag->bit_name,
+ tag->bit_val);
+ else
+ printf(" tag: NULL\n");
+ }
+ printf("\n");
+}
+
int main(int argc, char**argv)
{
blkid_cache cache = NULL;