X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubox.git;a=blobdiff_plain;f=block.c;h=2289b779a7a485642789cfc303091ee19a0f4b7a;hp=d4cf08945592af608b3485b50cc794267ae3f3b7;hb=a9cb25c5c2b9d864f77033533fab9f2f8a6f94ab;hpb=5290ec879aa4d9f4192df00aad4434b0f0afa872 diff --git a/block.c b/block.c index d4cf089..2289b77 100644 --- a/block.c +++ b/block.c @@ -302,7 +302,13 @@ static int swap_add(struct uci_section *s) /* store complete swap path */ if (tb[SWAP_DEVICE]) m->target = blobmsg_get_strdup(tb[SWAP_DEVICE]); - vlist_add(&mounts, &m->node, (m->uuid) ? (m->uuid) : (m->device)); + + if (m->uuid) + vlist_add(&mounts, &m->node, m->uuid); + else if (m->label) + vlist_add(&mounts, &m->node, m->label); + else if (m->device) + vlist_add(&mounts, &m->node, m->device); } return 0; @@ -539,8 +545,10 @@ static char* find_mount_point(char *block) char *p = &line[len + 1]; char *t = strstr(p, " "); - if (!t) + if (!t) { + fclose(fp); return NULL; + } *t = '\0'; point = p; break;