[PATCH v2 23/24] bbu: Report update failures explicitly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 common/bbu.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/common/bbu.c b/common/bbu.c
index 9e206227a..3974bf672 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;
 }
 
 /*
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux