}
static struct wipe_desc *
-get_desc_for_probe(struct wipe_desc *wp, blkid_probe pr)
+get_desc_for_probe(struct wipe_desc *wp, blkid_probe pr, int *found)
{
const char *off, *type, *mag, *p, *usage = NULL;
size_t len;
loff_t offset;
int rc, ispt = 0;
+ if (found)
+ *found = 0;
+
/* superblocks */
if (blkid_probe_lookup_value(pr, "TYPE", &type, NULL) == 0) {
rc = blkid_probe_lookup_value(pr, "SBMAGIC_OFFSET", &off, NULL);
if (blkid_probe_lookup_value(pr, "UUID", &p, NULL) == 0)
wp->uuid = xstrdup(p);
+ if (found)
+ *found = 1;
return wp;
}
return NULL;
while (blkid_do_probe(pr) == 0) {
- wp = get_desc_for_probe(wp, pr);
+ int found = 0;
+
+ wp = get_desc_for_probe(wp, pr, &found);
if (!wp)
break;
/* hide last detected signature and scan again */
- blkid_probe_hide_range(pr, wp->offset, wp->len);
- blkid_probe_step_back(pr);
+ if (found) {
+ blkid_probe_hide_range(pr, wp->offset, wp->len);
+ blkid_probe_step_back(pr);
+ }
}
blkid_free_probe(pr);
wp0 = clone_offset(wp);
while (blkid_do_probe(pr) == 0) {
- wp = get_desc_for_probe(wp, pr);
+ wp = get_desc_for_probe(wp, pr, NULL);
if (!wp)
break;