Some more const updates for Mac port.

This commit is contained in:
Stephen Anthony 2022-04-04 16:27:13 -02:30
parent ad850959c0
commit 5258d05167
1 changed files with 3 additions and 3 deletions

View File

@ -101,14 +101,14 @@ StringList SerialPortMACOS::portNames()
// Check if port is valid; for now that means if it can be opened
// Eventually we may extend this to do more intensive checks
auto isPortValid = [](const string& port) {
int handle = open(port.c_str(), O_RDWR | O_NOCTTY | O_NONBLOCK);
const auto isPortValid = [](const string& port) {
const int handle = open(port.c_str(), O_RDWR | O_NOCTTY | O_NONBLOCK);
if(handle > 0) close(handle);
return handle > 0;
};
// Get all possible devices in the '/dev' directory
FilesystemNode::NameFilter filter = [](const FilesystemNode& node) {
const FilesystemNode::NameFilter filter = [](const FilesystemNode& node) {
return BSPF::startsWithIgnoreCase(node.getPath(), "/dev/cu.usb");
};
FSList portList;