summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2021-05-01 20:10:21 +0200
committerPali Rohár <pali.rohar@gmail.com>2021-05-01 20:10:21 +0200
commit670db0d169672f5719663a2fc88e5aed39eb3f4f (patch)
treefeb8fecf15ef1a7593e8c7f15df52d4ce5b168f0
parent6eb58dcccb308a7bde71e9038a3e59a10da6f94c (diff)
download0xFFFF-670db0d169672f5719663a2fc88e5aed39eb3f4f.tar.bz2
main: Retry load and flash operations only on -EAGAIN error
-rw-r--r--src/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 6c64e6e..6314915 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1096,7 +1096,7 @@ int main(int argc, char **argv) {
if ( dev_load ) {
if ( image_kernel ) {
ret = dev_load_image(dev, image_kernel->image);
- if ( ret < 0 )
+ if ( ret == -EAGAIN )
goto again;
if ( image_kernel == image_first )
@@ -1110,7 +1110,7 @@ int main(int argc, char **argv) {
if ( image_initfs ) {
ret = dev_load_image(dev, image_initfs->image);
- if ( ret < 0 )
+ if ( ret == -EAGAIN )
goto again;
if ( image_initfs == image_first )
@@ -1129,7 +1129,7 @@ int main(int argc, char **argv) {
while ( image_ptr ) {
struct image_list * next = image_ptr->next;
ret = dev_flash_image(dev, image_ptr->image);
- if ( ret < 0 )
+ if ( ret == -EAGAIN )
goto again;
if ( image_ptr == image_first )