From 5100657c82762142e0987fe302855a1cd5a26d7c Mon Sep 17 00:00:00 2001 From: Ivan Gagis Date: Thu, 26 Sep 2024 10:54:54 +0300 Subject: [PATCH] fix lint --- src/bedsidemon/serial_port.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/bedsidemon/serial_port.cpp b/src/bedsidemon/serial_port.cpp index e4dd759..5b35b25 100644 --- a/src/bedsidemon/serial_port.cpp +++ b/src/bedsidemon/serial_port.cpp @@ -41,7 +41,7 @@ const std::array baud_rate_map = { serial_port::serial_port(std::string_view port_filename, baud_rate baud_rate) : opros::waitable([&]() { // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg) - int fd = open(utki::make_string(port_filename).c_str(), O_RDWR | O_NOCTTY); + int fd = open(utki::make_string(port_filename).c_str(), O_RDWR | O_NOCTTY | O_NONBLOCK | O_NDELAY); if (fd < 0) { throw std::runtime_error("serial_port(): could not open serial port"); } @@ -73,10 +73,6 @@ serial_port::serial_port(std::string_view port_filename, baud_rate baud_rate) : throw std::runtime_error("serial_port(): could not set serial port config"); } - if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1) { - throw std::runtime_error("serial_port(): could not set non-blocking mode on the serial port"); - } - scope_exit.release(); return fd; }())