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/partitions/sgi.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/partitions/sgi.c')
-rw-r--r-- | libblkid/src/partitions/sgi.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libblkid/src/partitions/sgi.c b/libblkid/src/partitions/sgi.c index 36dda380c..4446e5327 100644 --- a/libblkid/src/partitions/sgi.c +++ b/libblkid/src/partitions/sgi.c @@ -25,8 +25,11 @@ static int probe_sgi_pt(blkid_probe pr, int i; l = (struct sgi_disklabel *) blkid_probe_get_sector(pr, 0); - if (!l) + if (!l) { + if (errno) + return -errno; goto nothing; + } if (sgi_pt_checksum(l)) { DBG(LOWPROBE, blkid_debug( @@ -36,11 +39,11 @@ static int probe_sgi_pt(blkid_probe pr, if (blkid_partitions_need_typeonly(pr)) /* caller does not ask for details about partitions */ - return 0; + return BLKID_PROBE_OK; ls = blkid_probe_get_partlist(pr); if (!ls) - goto err; + goto nothing; tab = blkid_partlist_new_parttable(ls, "sgi", 0); if (!tab) @@ -63,12 +66,12 @@ static int probe_sgi_pt(blkid_probe pr, blkid_partition_set_type(par, type); } - return 0; + return BLKID_PROBE_OK; nothing: - return 1; + return BLKID_PROBE_NONE; err: - return -1; + return -ENOMEM; } const struct blkid_idinfo sgi_pt_idinfo = |