X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=blobdiff_plain;f=compat%2Flib%2Fbylabel.c;h=978a39d1d6ff358dc4c47151410a83c4943ca6b0;hp=c91457d3d232d7b47ff0209dc2a7c0531c79d4c6;hb=a23c5022421f8f7e2182300beb938167a3975286;hpb=58d8534847bc23e3b476372c11b368e4020676f7 diff --git a/compat/lib/bylabel.c b/compat/lib/bylabel.c index c91457d..978a39d 100644 --- a/compat/lib/bylabel.c +++ b/compat/lib/bylabel.c @@ -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; +}