[PATCH 02/14] commands: edit: properly propagate error code

Lucas Stach dev at lynxeye.de
Fri Feb 7 03:48:44 EST 2014


Signed-off-by: Lucas Stach <dev at lynxeye.de>
---
 commands/edit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commands/edit.c b/commands/edit.c
index 295d0a7..6b34101 100644
--- a/commands/edit.c
+++ b/commands/edit.c
@@ -266,7 +266,7 @@ static int save_file(const char *path)
 	fd = open(path, O_WRONLY | O_TRUNC | O_CREAT);
 	if (fd < 0) {
 		printf("could not open file for writing: %s\n", errno_str());
-		return -1;
+		return fd;
 	}
 
 	line = buffer;
-- 
1.8.5.3




More information about the barebox mailing list