From fbdfa76ccfefbfd0c59344ccdcccf9d5fc7ff8ed Mon Sep 17 00:00:00 2001 From: Ulrich Ölmann Date: Mon, 5 Sep 2016 21:36:18 +0200 Subject: commands: ubiupdatevol: confirm success with return value 0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Sascha Hauer --- commands/ubi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'commands/ubi.c') 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; } -- cgit v1.2.3