diff options
author | Karel Zak <kzak@redhat.com> | 2011-12-08 14:22:04 +0100 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2011-12-08 14:22:04 +0100 |
commit | 83ae4c2496faf6cbe478c9626616e51a7afed513 (patch) | |
tree | e8f3482ccad6f52e77920be0781a93d4e769a030 /partx | |
parent | 8275b7326e535c6d745414baca680f03e9eccdf3 (diff) | |
download | util-linux-83ae4c2496faf6cbe478c9626616e51a7afed513.tar.gz |
partx: don't treat empty partition table as error
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>
Diffstat (limited to 'partx')
-rw-r--r-- | partx/partx.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/partx/partx.c b/partx/partx.c index 6a3d3555..b4a3af7a 100644 --- a/partx/partx.c +++ b/partx/partx.c @@ -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; } |