9
0
Fork 0

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>
This commit is contained in:
Ulrich Ölmann 2016-09-05 21:36:18 +02:00 committed by Sascha Hauer
parent 90494c6f7e
commit fbdfa76ccf
1 changed files with 3 additions and 2 deletions

View File

@ -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;
}