瀏覽代碼

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

Eric LGF 1 年之前
父節點
當前提交
0893bf7a56
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      components/utilities/ymodem/ry_sy.c

+ 3 - 0
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;
 }