From a43d77c2e3c90e90401392e9a7c26be5fea2545e Mon Sep 17 00:00:00 2001 From: MacRsh Date: Tue, 16 Jan 2024 04:10:20 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=8F=8F=E8=BF=B0=E7=AC=A6=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=A3=80=E6=9F=A5=EF=BC=8C=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=B7=AF=E5=BE=84=E7=AD=89=E7=8B=AC=E7=AB=8B?= =?UTF-8?q?=E5=87=BD=E6=95=B0=EF=BC=8C=E4=BB=85=E4=BF=9D=E7=95=99=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E6=8F=8F=E8=BF=B0=E7=AC=A6=E6=98=AF=E5=90=A6=E6=9C=89?= =?UTF-8?q?=E6=95=88=E7=9A=84=E7=8B=AC=E7=AB=8B=E6=8E=A5=E5=8F=A3=E3=80=82?= =?UTF-8?q?=202.=E4=BF=AE=E6=94=B9ioctl=E6=93=8D=E4=BD=9C=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E5=90=8E=E8=BF=94=E5=9B=9E=E5=80=BC=E4=B8=BA=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E5=AD=97=E8=8A=82=E6=95=B0=E3=80=82=203.=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E8=8E=B7=E5=8F=96sflags=E3=80=81oflags=E3=80=81path?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/service.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/service.c b/source/service.c index 13afbb3..3998eb2 100644 --- a/source/service.c +++ b/source/service.c @@ -98,7 +98,7 @@ MR_WEAK int mr_printf_output(const char *buf, size_t size) { static int desc = -1; - if (desc < 0) + if (mr_dev_is_valid(desc) == MR_FALSE) { #ifndef MR_CFG_PRINTF_DEV_NAME #define MR_CFG_PRINTF_DEV_NAME "serial1" @@ -108,7 +108,7 @@ MR_WEAK int mr_printf_output(const char *buf, size_t size) #else console = mr_dev_open(MR_CFG_PRINTF_DEV_NAME, MR_OFLAG_RDWR | MR_OFLAG_NONBLOCK); #endif /* MR_USING_PRINTF_NONBLOCKING */ - if (desc < 0) + if (mr_dev_is_valid(desc) == MR_FALSE) { return desc; }