[Bug 673] [PATCH] Handle the DFU status value correctly during download
bugzilla-daemon at bugzilla.openmoko.org
bugzilla-daemon at bugzilla.openmoko.org
Tue Jul 31 15:20:12 CEST 2007
http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=673
------- Additional Comments From nick at anywi.com 2007-07-31 15:20 -------
... and return a correct error value to the caller, so we get an error in $?
after exit of the program.
Index: sam7dfu.c
===================================================================
--- sam7dfu.c (revision 2384)
+++ sam7dfu.c (working copy)
@@ -127,8 +127,15 @@
goto out_close;
}
usleep(5000);
- } while (dst.bState != DFU_STATE_dfuDNLOAD_IDLE ||
- dst.bStatus != DFU_STATUS_OK);
+ } while (dst.bState != DFU_STATE_dfuDNLOAD_IDLE);
+ if (dst.bStatus != DFU_STATUS_OK) {
+ printf(" failed!\n");
+ printf("state(%u) = %s, status(%u) = %s\n",
dst.bState,
+ dfu_state_to_string(dst.bState), dst.bStatus,
+ dfu_status_to_string(dst.bStatus));
+ ret = -1;
+ goto out_close;
+ }
hashes_todo = (bytes_sent / bytes_per_hash) - hashes;
hashes += hashes_todo;
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
More information about the buglog
mailing list