Use tcflush() before tcsetattr() in src/kiss.c

This commit is contained in:
XANTRONIX Development 2020-08-24 16:06:07 -05:00 committed by XANTRONIX Industrial
parent 6bb71a37ff
commit 5edb889471

View file

@ -140,13 +140,13 @@ patty_kiss_tnc *patty_kiss_tnc_new_fd(int fd) {
cfmakeraw(&tnc->attrs);
if (tcsetattr(fd, TCSANOW, &tnc->attrs) < 0) {
goto error_tcsetattr;
}
if (tcflush(fd, TCIOFLUSH) < 0) {
goto error_tcflush;
}
if (tcsetattr(fd, TCSANOW, &tnc->attrs) < 0) {
goto error_tcsetattr;
}
} else {
errno = 0;
}