Author: hailfinger Date: 2009-07-24 14:18:54 +0200 (Fri, 24 Jul 2009) New Revision: 666
Modified: trunk/flashrom.c Log: If writing failed, verifying is pointless. Abort instead.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net Acked-by: Oliver Niesner oli@rhce.servebbs.net
Modified: trunk/flashrom.c =================================================================== --- trunk/flashrom.c 2009-07-23 12:42:01 UTC (rev 665) +++ trunk/flashrom.c 2009-07-24 12:18:54 UTC (rev 666) @@ -851,12 +851,17 @@ fprintf(stderr, "Error: flashrom has no write function for this flash chip.\n"); return 1; } - ret |= flash->write(flash, buf); - if (!ret) printf("COMPLETE.\n"); + ret = flash->write(flash, buf); + if (ret) { + fprintf(stderr, "FAILED!\n"); + return 1; + } else { + printf("COMPLETE.\n"); + } }
if (verify_it) - ret |= verify_flash(flash, buf); + ret = verify_flash(flash, buf);
programmer_shutdown();