[PATCH] edit: Return error when save_file failed
Enrico Jorns
ejo at pengutronix.de
Tue Nov 3 08:19:01 PST 2015
When writing a file failed (e.g. due to a read-only file system), no
error was reported by the 'edit' tool. To be valid (and to not confuse
the poor user) at least '1' should be returned to indicate an error.
Signed-off-by: Enrico Jorns <ejo at pengutronix.de>
---
commands/edit.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/commands/edit.c b/commands/edit.c
index b28e2b9..2d9c8b5 100644
--- a/commands/edit.c
+++ b/commands/edit.c
@@ -533,7 +533,8 @@ static int do_edit(int argc, char *argv[])
}
break;
case 4:
- save_file(argv[1]);
+ if (save_file(argv[1]))
+ return 1;
goto out;
case 3:
goto out;
--
2.6.1
More information about the barebox
mailing list