From: Karel Zak Date: Wed, 25 Aug 2010 09:26:57 +0000 (+0200) Subject: libmount: cleanup return codes (optmap.c) X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4e669d7e59adfaf5d3438b060d5fc50263c23b1;p=util-linux libmount: cleanup return codes (optmap.c) Signed-off-by: Karel Zak --- diff --git a/shlibs/mount/src/optmap.c b/shlibs/mount/src/optmap.c index 12ead402..8f641cb2 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 is "={" or "={}" */ + return -EINVAL; /* hmm... option 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;