[PATCH 2/2] mtd: ubiformat: Add confirmation fail exit
hujianyang
hujianyang at huawei.com
Mon Jan 5 17:48:28 PST 2015
On 2015/1/5 23:07, Joseph Balough wrote:
>
> On Sat, Jan 3, 2015 at 9:38 PM, hujianyang <hujianyang at huawei.com <mailto:hujianyang at huawei.com>> wrote:
>
>
> There is not need to return different values for any error cases, and a
> positive return value is not proper for a aborted case.
>
> Just print a error message at failure happening is enough, I think.
>
>
> It was useful for me to know what the specific error was -- A messed up ubi file could indicate a bad download while a confirm error could indicate bad flash. It's no problem for me, I can just leave my patch as something I apply locally. I do wonder about the current exit value on error. ubiformat currently exits -1 when there is an error. The exit status for programs in UNIX are 8-bit unsigned integers, so the program actually exits 255. Perhaps this should at least return 1 instead of -1.
The exit status for programs in UNIX are 8-bit unsigned integers, so the program actually exits 255. Perhaps this should at least return 1 instead of -1.
Yes, you are right~!
Sorry for it.
More information about the linux-mtd
mailing list