summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/sbc_harness/fs_harness_flash_bin.c3
-rw-r--r--cmd/sbc_harness/ihex.c6
-rw-r--r--cmd/sbc_harness/ihex.h1
3 files changed, 10 insertions, 0 deletions
diff --git a/cmd/sbc_harness/fs_harness_flash_bin.c b/cmd/sbc_harness/fs_harness_flash_bin.c
index 6ae9e77..510a247 100644
--- a/cmd/sbc_harness/fs_harness_flash_bin.c
+++ b/cmd/sbc_harness/fs_harness_flash_bin.c
@@ -284,6 +284,9 @@ static void flash_file_iofree(struct flash_file *self) {
error err = flashio_close(&self->io);
assert(ERROR_IS_NULL(err));
+
+ err = ihex_decoder_close(&self->ihex);
+ assert(ERROR_IS_NULL(err));
}
static error flash_file_pread(struct flash_file *self, struct lib9p_srv_ctx *ctx,
diff --git a/cmd/sbc_harness/ihex.c b/cmd/sbc_harness/ihex.c
index 565ad16..5a7f6d5 100644
--- a/cmd/sbc_harness/ihex.c
+++ b/cmd/sbc_harness/ihex.c
@@ -15,6 +15,7 @@
#include "ihex.h"
LO_IMPLEMENTATION_C(io_writer, struct ihex_decoder, ihex_decoder);
+LO_IMPLEMENTATION_C(io_closer, struct ihex_decoder, ihex_decoder);
enum ihex_record_type {
/* [U]SBA: [Upper] Segment Base Address : SBA = USBA<< 4 */
@@ -223,3 +224,8 @@ size_t_and_error ihex_decoder_writev(struct ihex_decoder *self, const struct iov
}
return ERROR_AND(size_t, total, ERROR_NULL);
}
+
+error ihex_decoder_close(struct ihex_decoder *self) {
+ error_cleanup(&self->sticky_err);
+ return ERROR_NULL;
+}
diff --git a/cmd/sbc_harness/ihex.h b/cmd/sbc_harness/ihex.h
index d5ac70c..35a3cbe 100644
--- a/cmd/sbc_harness/ihex.h
+++ b/cmd/sbc_harness/ihex.h
@@ -44,5 +44,6 @@ struct ihex_decoder {
END_PRIVATE(IHEX_H);
};
LO_IMPLEMENTATION_H(io_writer, struct ihex_decoder, ihex_decoder);
+LO_IMPLEMENTATION_H(io_closer, struct ihex_decoder, ihex_decoder);
#endif /* _SBC_HARNESS_IHEX_H_ */