summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorLucas Stach <dev@lynxeye.de>2014-02-07 09:48:44 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2014-02-10 08:49:55 +0100
commit0569bb12a6334becc7cd38ea350a5fe6a03ebcb7 (patch)
treefd2267bb2795e2fb345dc27cf47e30e6c747f1a1 /commands
parentaa6694b5422dc2d598ce09179b9ad9de8fa403b4 (diff)
downloadbarebox-0569bb12a6334becc7cd38ea350a5fe6a03ebcb7.tar.gz
barebox-0569bb12a6334becc7cd38ea350a5fe6a03ebcb7.tar.xz
commands: edit: properly propagate error code
Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/edit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/edit.c b/commands/edit.c
index 295d0a709e..6b34101163 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;