diff options
author | Hannes Reinecke | 2014-03-20 11:03:50 +0100 |
---|---|---|
committer | Karel Zak | 2014-03-20 15:26:48 +0100 |
commit | 37f4060225df0591ab8e1dd676dbc8115d900d4f (patch) | |
tree | 47b445e8868687025b4769ada1824a5bdd2e8b8e /libblkid/src/superblocks/udf.c | |
parent | blkid: stop scanning on I/O error (diff) | |
download | kernel-qcow2-util-linux-37f4060225df0591ab8e1dd676dbc8115d900d4f.tar.gz kernel-qcow2-util-linux-37f4060225df0591ab8e1dd676dbc8115d900d4f.tar.xz kernel-qcow2-util-linux-37f4060225df0591ab8e1dd676dbc8115d900d4f.zip |
blkid: convert superblocks to new calling convention
With the previous patch the scanning functions were
modified to return a differentiated return code.
To correctly abort scanning when an I/O error occurs
we need to differentiate between 'error' (= -1) and
'not found' (= 1) in the probe functions.
This patch updates all superblock scanning functions
to the new calling convention.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid/src/superblocks/udf.c')
-rw-r--r-- | libblkid/src/superblocks/udf.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libblkid/src/superblocks/udf.c b/libblkid/src/superblocks/udf.c index 8702dd04b..5cde3cc2a 100644 --- a/libblkid/src/superblocks/udf.c +++ b/libblkid/src/superblocks/udf.c @@ -85,11 +85,11 @@ static int probe_udf(blkid_probe pr, UDF_VSD_OFFSET + b, sizeof(*vsd)); if (!vsd) - return 1; + return errno ? -errno : 1; if (vsd->id[0] != '\0') goto nsr; } - return -1; + return 1; nsr: /* search the list of VSDs for a NSR descriptor */ @@ -99,15 +99,15 @@ nsr: UDF_VSD_OFFSET + ((blkid_loff_t) b * 0x800), sizeof(*vsd)); if (!vsd) - return -1; + return errno ? -errno : 1; if (vsd->id[0] == '\0') - return -1; + return 1; if (memcmp(vsd->id, "NSR02", 5) == 0) goto anchor; if (memcmp(vsd->id, "NSR03", 5) == 0) goto anchor; } - return -1; + return 1; anchor: /* read Anchor Volume Descriptor (AVDP), checking block size */ @@ -115,7 +115,7 @@ anchor: vd = (struct volume_descriptor *) blkid_probe_get_buffer(pr, 256 * pbs[i], sizeof(*vd)); if (!vd) - return -1; + return errno ? -errno : 1; type = le16_to_cpu(vd->tag.id); if (type == 2) /* TAG_ID_AVDP */ @@ -138,7 +138,7 @@ real_blksz: (blkid_loff_t) (loc + b) * bs, sizeof(*vd)); if (!vd) - return -1; + return errno ? -errno : 1; } /* Try extract all possible ISO9660 information -- if there is @@ -155,7 +155,7 @@ real_blksz: (blkid_loff_t) (loc + b) * bs, sizeof(*vd)); if (!vd) - return -1; + return errno ? -errno : 1; type = le16_to_cpu(vd->tag.id); if (type == 0) break; |