From: Karel Zak Date: Wed, 7 Nov 2012 13:25:32 +0000 (+0100) Subject: lsblk: don't ignore disk device X-Git-Tag: v2.23-rc1~562 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0e3e3de7b13fabf8db1dac3cd12095933c79c59;p=thirdparty%2Futil-linux.git lsblk: don't ignore disk device Signed-off-by: Karel Zak --- diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c index bca44492e2..ed17839c88 100644 --- a/misc-utils/lsblk.c +++ b/misc-utils/lsblk.c @@ -1043,12 +1043,12 @@ static int list_partitions(struct blkdev_cxt *wholedisk_cxt, struct blkdev_cxt * * `- * `-... */ - if (set_cxt(&part_cxt, wholedisk_cxt, wholedisk_cxt, d->d_name)) - goto next; + int ps = set_cxt(&part_cxt, wholedisk_cxt, wholedisk_cxt, d->d_name); + /* Print whole disk only once */ if (r) print_device(wholedisk_cxt, parent_cxt ? parent_cxt->tt_line : NULL); - if (!lsblk->nodeps) + if (ps == 0 && !lsblk->nodeps) process_blkdev(&part_cxt, wholedisk_cxt, 0, NULL); } next: