[ymodem] fix the cmd "sy" without close file

This commit is contained in:
Eric LGF 2024-04-13 20:11:31 +08:00 committed by GitHub
parent acf4487177
commit 58ecde786f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -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;
}