mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Fix listing of serial devices on macOS
This commit is contained in:
parent
02cac07a77
commit
5f70b75e90
1 changed files with 8 additions and 0 deletions
|
|
@ -1407,6 +1407,14 @@ static bool is_serial_device(const char *format, ...)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
// Make sure device name is on the form /dev/cu.* or /dev/tty.*
|
||||||
|
if ((strncmp(filename, "/dev/cu.", 8) != 0) && (strncmp(filename, "/dev/tty.", 9) != 0))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
fd = open(filename, O_RDONLY | O_NONBLOCK | O_NOCTTY);
|
fd = open(filename, O_RDONLY | O_NONBLOCK | O_NOCTTY);
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue