From: Jo-Philipp Wich Date: Thu, 5 Sep 2013 15:19:41 +0000 (+0200) Subject: block: properly handle vlist_add() for label, uuid and device cases X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubox.git;a=commitdiff_plain;h=0acfbd17311d2c1bbaac031ae719296d9df85b55 block: properly handle vlist_add() for label, uuid and device cases --- diff --git a/block.c b/block.c index d4cf089..c9285d6 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;