]> git.wh0rd.org - dump.git/blobdiff - compat/lib/bylabel.c
Fix a compile problem (e2fs label related).
[dump.git] / compat / lib / bylabel.c
index c91457d3d232d7b47ff0209dc2a7c0531c79d4c6..978a39d1d6ff358dc4c47151410a83c4943ca6b0 100644 (file)
@@ -229,3 +229,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;
+}