Skip tcgetattr() in patty_kiss_tnc_new_fd() w/ptmx

Modify patty_kiss_tnc_new_fd() to avoid tcgetattr()/tcsetattr() when
passed a file descriptor for a PTY master, to address incompatibility
with BSD kernelspace Unix98 PTY implementations
This commit is contained in:
XANTRONIX Development 2020-08-01 20:13:48 -04:00 committed by XANTRONIX Industrial
parent 3d12ab33e3
commit 81d063cb68

View file

@ -52,7 +52,7 @@ patty_kiss_tnc *patty_kiss_tnc_new_fd(int fd) {
goto error_malloc_buf;
}
if (isatty(fd)) {
if (isatty(fd) && ptsname(fd) == NULL) {
if (tcgetattr(fd, &tnc->attrs) < 0) {
goto error_tcgetattr;
}