Skip to contentSkip to conversation

partx: don't treat empty partition table as error

PATCH In review Phillip Susi 2 participants 2 messages Dec 5, 2011 – Dec 8, 2011 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 4/4 partx: don't treat empty partition table as error

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 and for partx -u, prevented update from removing all partitions.

---
 partx/partx.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
partx/partx.c +0 -6
index 50b0c20..f4f2db1 100644
@@ -696,12 +696,6 @@ static blkid_partlist get_partlist(blkid_probe pr,
 		printf(_("%s: partition table type '%s' detected\n"),
 		       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;
-	}
 	return ls;
 }
 
Signature · 1 line
1.7.5.4
maintainer
#1 lore raw

partx/partx.c static blkid_partlist get_partlist(blkid_probe pr, · line 704

Quoted 6 lines · Phillip Susi
partx/partx.c +0 -6
-	if (!blkid_partlist_numof_partitions(ls)) {
-		warnx(_("%s: %s partition table does not contains "
-			"usable partitions"), device,
-			blkid_parttable_get_type(tab));
-		return NULL;
-	}

I have replaced the warnign and return NULL with message printed in verbose mode only.

Thanks!

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com