summaryrefslogtreecommitdiffstats
path: root/commands/of_diff.c
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-02-07 09:27:59 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2022-02-07 09:35:41 +0100
commitcfa1e13fba762f3be4d193523ddcc7ea76018c53 (patch)
treebdfce3b8707526a2572ec1a4fc78af1e0bb0b0b4 /commands/of_diff.c
parent616ff0948058b96c258caa95c93b2b61ec746ca7 (diff)
downloadbarebox-cfa1e13fba762f3be4d193523ddcc7ea76018c53.tar.gz
barebox-cfa1e13fba762f3be4d193523ddcc7ea76018c53.tar.xz
of: report whether of_diff found differences in return code
Tests may want to leverage of_diff to verify that fixups proceeded as expected. of_diff lends itself nicely to that by being silent in case of success and just reporting diff on error. Add a return code to make it usable in follow-up tests. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220207082801.1052894-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/of_diff.c')
-rw-r--r--commands/of_diff.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/commands/of_diff.c b/commands/of_diff.c
index fa99fcd641..6a78263200 100644
--- a/commands/of_diff.c
+++ b/commands/of_diff.c
@@ -77,9 +77,7 @@ static int do_of_diff(int argc, char *argv[])
goto out;
}
- of_diff(a, b, 0);
-
- ret = 0;
+ ret = of_diff(a, b, 0) ? COMMAND_ERROR : COMMAND_SUCCESS;
out:
if (a && a != root)
of_delete_node(a);