Make the libdevmapper fail quietly if blkid is called without root
privileges or the kernel does not include device mapper support.
(What is the device mapper _library_ doing writing to stderr, anyway?)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
+2006-03-19 Theodore Ts'o <tytso@mit.edu>
+
+ * devname.c (dm_probe_all, dm_device_is_leaf): Make the
+ libdevmapper fail quietly if blkid is called without root
+ privileges or the kernel does not include device mapper
+ support. (What is the device mapper _library_ doing
+ writing to stderr, anyway?)
+
2006-03-12 Theodore Ts'o <tytso@mit.edu>
* probe.c (blkid_verify): Fix the bid_time sanity checking logic,
}
#ifdef HAVE_DEVMAPPER
+static void dm_quiet_log(int level, const char *file, int line,
+ const char *f, ...)
+{
+ return;
+}
+
/*
* device-mapper support
*/
unsigned int next = 0;
int n, ret = 1;
+ dm_log_init(dm_quiet_log);
task = dm_task_create(DM_DEVICE_LIST);
if (!task)
return 1;
+ dm_log_init(0);
dm_task_run(task);
names = dm_task_get_names(task);
unsigned int next = 0;
int n;
+ dm_log_init(dm_quiet_log);
task = dm_task_create(DM_DEVICE_LIST);
if (!task)
return;
+ dm_log_init(0);
dm_task_run(task);
names = dm_task_get_names(task);