diff options
author | Karel Zak | 2011-11-15 12:49:31 +0100 |
---|---|---|
committer | Karel Zak | 2011-11-15 12:49:31 +0100 |
commit | e13fe2063c5f7dd7b4ae7427e4dce72312b5e953 (patch) | |
tree | c710ec8d7d697eb69c07c832393873543032b5a2 /libblkid | |
parent | fdisk: split delete_partition() off from dos_delete_partition() (diff) | |
download | kernel-qcow2-util-linux-e13fe2063c5f7dd7b4ae7427e4dce72312b5e953.tar.gz kernel-qcow2-util-linux-e13fe2063c5f7dd7b4ae7427e4dce72312b5e953.tar.xz kernel-qcow2-util-linux-e13fe2063c5f7dd7b4ae7427e4dce72312b5e953.zip |
libblkid: export PTMAGIC also if only PTTYPE requested
Reported-by: David Zeuthen <davidz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid')
-rw-r--r-- | libblkid/src/partitions/gpt.c | 8 | ||||
-rw-r--r-- | libblkid/src/partitions/ultrix.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/libblkid/src/partitions/gpt.c b/libblkid/src/partitions/gpt.c index bee6e26f4..0e44f6e82 100644 --- a/libblkid/src/partitions/gpt.c +++ b/libblkid/src/partitions/gpt.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); diff --git a/libblkid/src/partitions/ultrix.c b/libblkid/src/partitions/ultrix.c index dd18fe3da..fb195f646 100644 --- a/libblkid/src/partitions/ultrix.c +++ b/libblkid/src/partitions/ultrix.c @@ -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); |