From 58ecde786f084d78a780bbc07533c7dde8d226c2 Mon Sep 17 00:00:00 2001 From: Eric LGF Date: Sat, 13 Apr 2024 20:11:31 +0800 Subject: [PATCH] [ymodem] fix the cmd "sy" without close file --- components/utilities/ymodem/ry_sy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/utilities/ymodem/ry_sy.c b/components/utilities/ymodem/ry_sy.c index 557d4bcdab..89664f1ad9 100644 --- a/components/utilities/ymodem/ry_sy.c +++ b/components/utilities/ymodem/ry_sy.c @@ -186,7 +186,10 @@ static enum rym_code _rym_send_end( rt_uint8_t *buf, rt_size_t len) { + struct custom_ctx *cctx = (struct custom_ctx *)ctx; rt_memset(buf, 0, len); + close(cctx->fd); + cctx->fd = -1; return RYM_CODE_SOH; }