]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsblk: don't ignore disk device
authorKarel Zak <kzak@redhat.com>
Wed, 7 Nov 2012 13:25:32 +0000 (14:25 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 7 Nov 2012 13:25:32 +0000 (14:25 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/lsblk.c

index bca44492e262f6796ad6803eb2cedd401832b3f7..ed17839c8860e72b81ab4132fc9ed0e7a9db0d88 100644 (file)
@@ -1043,12 +1043,12 @@ static int list_partitions(struct blkdev_cxt *wholedisk_cxt, struct blkdev_cxt *
                         *   `-<part_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: