chiark / gitweb /
volume_id: provide a custom debug function
[elogind.git] / extras / volume_id / libvolume_id / volume_id.c
index fdecf396c4abadd090dd4f0828d32153dbf660de..073ad79c7723834e7f72291ea3557353a5466e46 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * volume_id - reads filesystem label and uuid
+ * volume_id - reads volume label and uuid
  *
  * Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
  *
 #include <fcntl.h>
 #include <sys/stat.h>
 
-#include "volume_id.h"
-#include "logging.h"
+#include "libvolume_id.h"
 #include "util.h"
 
+/* the user can overwrite this log function */
+static void default_log(int priority, const char *file, int line, const char *format, ...)
+{
+       return;
+}
+
+volume_id_log_fn volume_id_log = default_log;
 
 int volume_id_probe_raid(struct volume_id *id, uint64_t off, uint64_t size)
 {
@@ -221,8 +227,5 @@ void volume_id_close(struct volume_id *id)
 
        volume_id_free_buffer(id);
 
-       if (id->partitions != NULL)
-               free(id->partitions);
-
        free(id);
 }