X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/8114ef99e3071e1871d1680cf77063be52bbaf0a..a4bdef9ca9051d829ee12f9f8ae36016f0c2136e:/package/mtd/src/mtd.c diff --git a/package/mtd/src/mtd.c b/package/mtd/src/mtd.c index 6e430f4b5..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,9 +137,11 @@ int mtd_write_buffer(int fd, const char *buf, int offset, int length) static int image_check(int imagefd, const char *mtd) { + int ret = 1; #ifdef target_brcm - return trx_check(imagefd, mtd, buf, &buflen); + ret = trx_check(imagefd, mtd, buf, &buflen); #endif + return ret; } static int mtd_check(const char *mtd) @@ -274,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);