]> git.wh0rd.org - dump.git/blobdiff - compat/lib/bylabel.c
LFS compatibility.
[dump.git] / compat / lib / bylabel.c
index c91457d3d232d7b47ff0209dc2a7c0531c79d4c6..31bdd0d601746b66a31b477ff73461a040b18ed6 100644 (file)
@@ -11,6 +11,7 @@
  * - Ported to dump/restore
  */
 
+#include <config.h>
 #include <stdio.h>
 #include <sys/param.h>
 #include <string.h>
@@ -229,3 +230,18 @@ get_device_name(const char * item) {
 
        return rc;
 }
+
+const char *
+get_device_label(const char * spec) {
+       struct uuidCache_s *uc;
+
+       uuidcache_init();
+       uc = uuidCache;
+
+       while(uc) {
+               if (!strcmp(spec, uc->device))
+                       return uc->label[0] == '\0' ? NULL : strdup(uc->label);
+               uc = uc->next;
+       }
+       return NULL;
+}