summaryrefslogtreecommitdiffstats
path: root/flashrom.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-07-24 12:18:54 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-07-24 12:18:54 +0000
commitb4d60583393a012100ba9d00b6e9bf1c792d1ed1 (patch)
tree8900da78fef5b193830de8a43ef713da4613990c /flashrom.c
parent4a469a239ec45802f4d67f7acf14045b514d8c98 (diff)
downloadflashrom-b4d60583393a012100ba9d00b6e9bf1c792d1ed1.zip
flashrom-b4d60583393a012100ba9d00b6e9bf1c792d1ed1.tar.gz
If writing failed, verifying is pointless
Abort instead. Corresponding to flashrom svn r666. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Oliver Niesner <oli@rhce.servebbs.net>
Diffstat (limited to 'flashrom.c')
-rw-r--r--flashrom.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/flashrom.c b/flashrom.c
index 5764872..cb0da72 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -851,12 +851,17 @@ int main(int argc, char *argv[])
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();
OpenPOWER on IntegriCloud