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/minix.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/minix.c')
-rw-r--r-- | libblkid/src/partitions/minix.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/libblkid/src/partitions/minix.c b/libblkid/src/partitions/minix.c index 0a597fbc4..2e2a221fa 100644 --- a/libblkid/src/partitions/minix.c +++ b/libblkid/src/partitions/minix.c @@ -25,26 +25,29 @@ static int probe_minix_pt(blkid_probe pr, int i; data = blkid_probe_get_sector(pr, 0); - if (!data) + if (!data) { + if (errno) + return -errno; goto nothing; + } ls = blkid_probe_get_partlist(pr); if (!ls) - goto err; + goto nothing; /* Parent is required, because Minix uses the same PT as DOS and * difference is only in primary partition (parent) type. */ parent = blkid_partlist_get_parent(ls); if (!parent) - goto nothing; + goto err; if (blkid_partition_get_type(parent) != MBR_MINIX_PARTITION) goto nothing; if (blkid_partitions_need_typeonly(pr)) /* caller does not ask for details about partitions */ - return 0; + return BLKID_PROBE_OK; tab = blkid_partlist_new_parttable(ls, "minix", MBR_PT_OFFSET); if (!tab) @@ -77,12 +80,12 @@ static int probe_minix_pt(blkid_probe pr, blkid_partition_set_flags(par, p->boot_ind); } - return 0; + return BLKID_PROBE_OK; nothing: - return 1; + return BLKID_PROBE_NONE; err: - return -1; + return -ENOMEM; } /* same as DOS */ |