diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2018-08-23 19:52:42 -0700 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-08-31 08:30:08 +0200 |
commit | d0ce7942a910cfead622ab1ef4025ac58251501c (patch) | |
tree | d33c20f9d94ed06f8940019656c4a644421103b5 /common/bbu.c | |
parent | d83ad9d3123a1ae26aef033eaa70c06952ba1243 (diff) | |
download | barebox-d0ce7942a910cfead622ab1ef4025ac58251501c.tar.gz barebox-d0ce7942a910cfead622ab1ef4025ac58251501c.tar.xz |
bbu: Report update failures explicitly
Change the code of barebox_update() to explicitly log that update
failed instead of failing silently (unless update was interrupted) and
relying on user checking the return code.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/bbu.c')
-rw-r--r-- | common/bbu.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/common/bbu.c b/common/bbu.c index 9e206227a7..3974bf6729 100644 --- a/common/bbu.c +++ b/common/bbu.c @@ -260,13 +260,13 @@ int barebox_update(struct bbu_data *data) return ret; ret = handler->handler(handler, data); - if (ret == -EINTR) - printf("update aborted\n"); - - if (!ret) - printf("update succeeded\n"); + if (ret) { + printf("update %s\n", (ret == -EINTR) ? "aborted" : "failed"); + return ret; + } - return ret; + printf("update succeeded\n"); + return 0; } /* |