]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
UBI: Fix error code handling in ubi commands
authorStefan Roese <sr@denx.de>
Mon, 14 Mar 2011 13:34:21 +0000 (14:34 +0100)
committerStefan Roese <sr@denx.de>
Mon, 21 Mar 2011 09:02:16 +0000 (10:02 +0100)
commit7f5d8a4d8e0ef7aee08476f0a3b9eb40974efaee
tree9ea2d2bb6d71f222cc06481e5fae581ed4db5fcd
parentcc1dd33f273f8c96cbd7539b4a2d1d7aa12773cd
UBI: Fix error code handling in ubi commands

Some ubi commands returned negative error codes, resulting in
the following error message on the prompt:

"exit not allowed from main input shell."

Negative error codes are not allowed.

This patch now changes the UBI code to return positive error codes.
Additionally "better" error codes are used, for example "ENOMEM" when
no memory is available for the UBI volume creation any more.

Also the output of some commands is enhanced:

Before:

=> ubi read 100000 testvol 100000
Volume testvol found at volume id 0
read 1048576 bytes from volume 0 to 100000(buf address)
=> ubi write 100000 testvol 1000
Volume testvol found at volume id 0

After:

=> ubi read 100000 testvol 100000
Read 1048576 bytes from volume testvol to 00100000
=> ubi write 100000 testvol 1000
4096 bytes written to volume testvol

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
common/cmd_ubi.c