X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/a7c35fcd0d751f88939d856040facb0b5f8b382c..58387c96127bf43e0c4c6655e3fd3edb873cd06d:/package/mtd/src/mtd.c?ds=inline diff --git a/package/mtd/src/mtd.c b/package/mtd/src/mtd.c index b180aecfb..a19f71806 100644 --- a/package/mtd/src/mtd.c +++ b/package/mtd/src/mtd.c @@ -18,7 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Id$ * * The code is based on the linux-mtd examples. */ @@ -138,7 +137,7 @@ int mtd_write_buffer(int fd, const char *buf, int offset, int length) static int image_check(int imagefd, const char *mtd) { - int ret = 0; + int ret = 1; #ifdef target_brcm ret = trx_check(imagefd, mtd, buf, &buflen); #endif @@ -276,10 +275,8 @@ mtd_write(int imagefd, const char *mtd) } } - if (r == 0) { - fprintf(stderr, "No more data left\n"); + if (r == 0) break; - } buflen += r; } while (buflen < erasesize);