volumeid: fix bug 249 "findfs finds the wrong partition"
This commit is contained in:
parent
f6fbd62760
commit
9983d806d9
@ -223,13 +223,11 @@ void display_uuid_cache(void)
|
|||||||
char *get_devname_from_label(const char *spec)
|
char *get_devname_from_label(const char *spec)
|
||||||
{
|
{
|
||||||
struct uuidCache_s *uc;
|
struct uuidCache_s *uc;
|
||||||
int spec_len = strlen(spec);
|
|
||||||
|
|
||||||
uuidcache_init();
|
uuidcache_init();
|
||||||
uc = uuidCache;
|
uc = uuidCache;
|
||||||
while (uc) {
|
while (uc) {
|
||||||
// FIXME: empty label ("LABEL=") matches anything??!
|
if (uc->label[0] && strcmp(spec, uc->label) == 0) {
|
||||||
if (uc->label[0] && strncmp(spec, uc->label, spec_len) == 0) {
|
|
||||||
return xstrdup(uc->device);
|
return xstrdup(uc->device);
|
||||||
}
|
}
|
||||||
uc = uc->next;
|
uc = uc->next;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user