]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
partx: don't treat empty partition table as error
authorKarel Zak <kzak@redhat.com>
Thu, 8 Dec 2011 13:22:04 +0000 (14:22 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 8 Dec 2011 13:22:04 +0000 (14:22 +0100)
Phillip wrote:
 If a partition table was detected, but it had no partitions
 in it, a poorly worded error message was printed and further
 action halted.  For partx -a, this gave an unnecessary error.

Reported-by: Phillip Susi <psusi@cfl.rr.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
partx/partx.c

index 6a3d3555522a0593ea92684998ae68250f2de071..b4a3af7a2f4b05e4515e549ecea20ced98e2eaed 100644 (file)
@@ -592,16 +592,14 @@ static blkid_partlist get_partlist(blkid_probe pr,
        }
 
        tab = blkid_partlist_get_table(ls);
-       if (verbose && tab)
+       if (verbose && tab) {
                printf(_("%s: partition table type '%s' detected\n"),
-                      device, blkid_parttable_get_type(tab));
+                              device, blkid_parttable_get_type(tab));
 
-       if (!blkid_partlist_numof_partitions(ls)) {
-               warnx(_("%s: %s partition table does not contains "
-                       "usable partitions"), device,
-                       blkid_parttable_get_type(tab));
-               return NULL;
+               if (!blkid_partlist_numof_partitions(ls))
+                       printf(_("%s: partition table with no partitions"), device);
        }
+
        return ls;
 }