Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
igagis committed Sep 26, 2024
1 parent b8851e4 commit 5100657
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/bedsidemon/serial_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const std::array<speed_t, size_t(baud_rate::enum_size)> 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");
}
Expand Down Expand Up @@ -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;
}())
Expand Down

0 comments on commit 5100657

Please sign in to comment.