X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Ftarget%2Fimage.c;h=eafa73eaae648e4c347e128091702d5ed35d29de;hb=HEAD;hp=9175c200aff38b9e45e43185ebc4ae5dcff3b875;hpb=0f261188f1161a685b22c1e3d3e07b3666a31971;p=openocd.git diff --git a/src/target/image.c b/src/target/image.c index 9175c200af..440fe17d18 100644 --- a/src/target/image.c +++ b/src/target/image.c @@ -24,6 +24,7 @@ #include "image.h" #include "target.h" #include +#include /* convert ELF header field to host endianness */ #define field16(elf, field) \ @@ -1295,6 +1296,8 @@ int image_calculate_checksum(const uint8_t *buffer, uint32_t nbytes, uint32_t *c crc = (crc << 8) ^ crc32_table[((crc >> 24) ^ *buffer++) & 255]; } keep_alive(); + if (openocd_is_shutdown_pending()) + return ERROR_SERVER_INTERRUPTED; } LOG_DEBUG("Calculating checksum done; checksum=0x%" PRIx32, crc);