summaryrefslogtreecommitdiffstats
path: root/shlibs/mount/src/optmap.c
diff options
context:
space:
mode:
authorKarel Zak2010-08-25 11:26:57 +0200
committerKarel Zak2011-01-03 12:28:41 +0100
commite4e669d7e59adfaf5d3438b060d5fc50263c23b1 (patch)
tree4eece0ebfba3e8434a76545e19f7e00185d2503a /shlibs/mount/src/optmap.c
parentlibmount: cleanup return codes (lock.c) (diff)
downloadkernel-qcow2-util-linux-e4e669d7e59adfaf5d3438b060d5fc50263c23b1.tar.gz
kernel-qcow2-util-linux-e4e669d7e59adfaf5d3438b060d5fc50263c23b1.tar.xz
kernel-qcow2-util-linux-e4e669d7e59adfaf5d3438b060d5fc50263c23b1.zip
libmount: cleanup return codes (optmap.c)
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/optmap.c')
-rw-r--r--shlibs/mount/src/optmap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/shlibs/mount/src/optmap.c b/shlibs/mount/src/optmap.c
index 12ead4023..8f641cb2a 100644
--- a/shlibs/mount/src/optmap.c
+++ b/shlibs/mount/src/optmap.c
@@ -246,14 +246,14 @@ int mnt_optmap_enum_to_number(const struct mnt_optmap *mapent,
int n = -1;
if (!rawdata || !*rawdata || !mapent || !len)
- return -1;
+ return -EINVAL;
p = strrchr(mapent->name, '=');
if (!p || *(p + 1) == '{')
- return -1; /* value unexpected or not "enum" */
+ return -EINVAL; /* value unexpected or not "enum" */
p += 2;
if (!*p || *(p + 1) == '}')
- return -1; /* hmm... option <type> is "={" or "={}" */
+ return -EINVAL; /* hmm... option <type> is "={" or "={}" */
/* we cannot use strstr(), @rawdata is not terminated */
for (; p && *p; p++) {
@@ -266,7 +266,7 @@ int mnt_optmap_enum_to_number(const struct mnt_optmap *mapent,
if (!begin || !end)
continue;
if (end <= begin)
- return -1;
+ return -EINVAL;
n++;
if (len == end - begin && strncasecmp(begin, rawdata, len) == 0)
return n;