diff options
author | Stefan Agner <stefan@agner.ch> | 2015-04-10 12:25:43 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-04-10 18:54:06 +0300 |
commit | 6d0f45260846b8cafcae6a815178ff8ece7dea7a (patch) | |
tree | 6bbe20d30ad66b83c8c8632bc76539485a724c84 | |
parent | 763754549fa818d74c41e9e325e76fd881b42269 (diff) | |
download | u-boot-6d0f45260846b8cafcae6a815178ff8ece7dea7a.tar.xz |
common, ubi: use positive return values for ubi check
The ubi check command is expected to not fail and just check whether
a volume exist or not. Currently, when a volume does not exist, the
command fails which leads to an error:
"exit not allowed from main input shell."
Use 1 to indicate that a volume does not exist. This allows to use
ubi check in an if statement, e.g.
if ubi check rootfs; then; echo "exists"; else; echo "not there"; fi
-rw-r--r-- | common/cmd_ubi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/cmd_ubi.c b/common/cmd_ubi.c index 6c8570377e..cbc10c5494 100644 --- a/common/cmd_ubi.c +++ b/common/cmd_ubi.c @@ -114,7 +114,7 @@ static int ubi_check(char *name) return 0; } - return -EEXIST; + return 1; } |