Commit 67412f13 authored by Matheus Andrade's avatar Matheus Andrade

Fixing termios flags on macOS

Accordinng to http://kirste.userpage.fu-berlin.de/chemnet/use/info/libc/libc_12.html:
"CLOCAL
If this bit is set, it indicates that the terminal is connected "locally" and that the modem status lines (such as carrier detect) should be ignored.
On many systems if this bit is not set and you call open without the O_NONBLOCK flag set, open blocks until a modem connection is established."

Apparently (by testing and from a tip online), macOS is one of those systems.
parent 3820fba8
......@@ -151,6 +151,9 @@ void ttyopen(CleanString fn, int baudrate, int bytesize, int parity,
tio.c_lflag &= ~(ECHO | ECHONL | ICANON | IEXTEN | ISIG);
// tio.c_lflag |= ICANON;
#ifdef __APPLE__
tio.c_cflag |= CLOCAL;
#endif
tio.c_cc[VMIN]=5;
tio.c_cc[VTIME]=0;
tcsetattr(*fd, TCSANOW, &tio);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment