libblkid: export PTMAGIC also if only PTTYPE requested

Reported-by: David Zeuthen <davidz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
pull/4/head
Karel Zak 11 years ago
parent 47104bae89
commit e13fe2063c
  1. 8
      libblkid/src/partitions/gpt.c
  2. 8
      libblkid/src/partitions/ultrix.c

@ -315,6 +315,10 @@ static int probe_gpt_pt(blkid_probe pr,
blkid_probe_use_wiper(pr, lba * blkid_probe_get_size(pr), 8);
blkid_probe_set_magic(pr, lba << 9,
sizeof(GPT_HEADER_SIGNATURE_STR) - 1,
(unsigned char *) GPT_HEADER_SIGNATURE_STR);
if (blkid_partitions_need_typeonly(pr))
/* caller does not ask for details about partitions */
return 0;
@ -327,10 +331,6 @@ static int probe_gpt_pt(blkid_probe pr,
if (!tab)
goto err;
blkid_probe_set_magic(pr, lba << 9,
sizeof(GPT_HEADER_SIGNATURE_STR) - 1,
(unsigned char *) GPT_HEADER_SIGNATURE_STR);
ssf = blkid_probe_get_sectorsize(pr) / 512;
fu = le64_to_cpu(h->first_usable_lba);

@ -52,6 +52,10 @@ static int probe_ultrix_pt(blkid_probe pr,
if (l->pt_magic != ULTRIX_MAGIC || l->pt_valid != 1)
goto nothing;
blkid_probe_set_magic(pr, (ULTRIX_SECTOR << 9) + ULTRIX_OFFSET,
sizeof(ULTRIX_MAGIC_STR) - 1,
(unsigned char *) ULTRIX_MAGIC_STR);
if (blkid_partitions_need_typeonly(pr))
/* caller does not ask for details about partitions */
return 0;
@ -64,10 +68,6 @@ static int probe_ultrix_pt(blkid_probe pr,
if (!tab)
goto err;
blkid_probe_set_magic(pr, (ULTRIX_SECTOR << 9) + ULTRIX_OFFSET,
sizeof(ULTRIX_MAGIC_STR) - 1,
(unsigned char *) ULTRIX_MAGIC_STR);
for (i = 0; i < ULTRIX_MAXPARTITIONS; i++) {
if (!l->pt_part[i].pi_nblocks)
blkid_partlist_increment_partno(ls);

Loading…
Cancel
Save