From ace0d21975fb65dd722b808da2c64d8112b1ddb5 Mon Sep 17 00:00:00 2001 From: cainbit Date: Fri, 18 Feb 2022 10:06:49 +0800 Subject: [PATCH] fix UART setNonblock bug. --- UARTController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UARTController.cpp b/UARTController.cpp index 321c6f4..27aeed2 100644 --- a/UARTController.cpp +++ b/UARTController.cpp @@ -400,7 +400,7 @@ bool CUARTController::setRaw() #if defined(__APPLE__) int CUARTController::setNonblock(bool nonblock) { - int flag = ::fcntl(m_fd, F_GETFD, 0); + int flag = ::fcntl(m_fd, F_GETFL, 0); if (nonblock) flag |= O_NONBLOCK;