diff options
author | Ulrich Ölmann <u.oelmann@pengutronix.de> | 2016-09-05 21:36:18 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-09-06 16:21:22 +0200 |
commit | fbdfa76ccfefbfd0c59344ccdcccf9d5fc7ff8ed (patch) | |
tree | 1442eeb1159142fd8561c9ebf34f12a7418c7146 | |
parent | 90494c6f7e6036c1bfb614aeca81dbe2d362fd5a (diff) | |
download | barebox-fbdfa76ccfefbfd0c59344ccdcccf9d5fc7ff8ed.tar.gz barebox-fbdfa76ccfefbfd0c59344ccdcccf9d5fc7ff8ed.tar.xz |
commands: ubiupdatevol: confirm success with return value 0
Treat the write() case analogously to the read() case and do not return the
number of most recently written bytes as the status of sucessful command
execution.
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | commands/ubi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/commands/ubi.c b/commands/ubi.c index dd981f95ea..26b521f374 100644 --- a/commands/ubi.c +++ b/commands/ubi.c @@ -65,9 +65,10 @@ static int do_ubiupdatevol(int argc, char *argv[]) break; } - ret = write(fd_vol, buf, count); - if (ret < 0) { + count = write(fd_vol, buf, count); + if (count < 0) { perror("write"); + ret = 1; break; } |