- }
-
- while (tcsetattr(tty_fd, TCSAFLUSH, &tios) < 0 && !ok_error(errno))
- if (errno != EINTR)
- fatal("tcsetattr: %m (line %d)", __LINE__);
- restore_term = 1;
-
-/* Most Linux architectures and drivers support arbitrary baud rate values via BOTHER */
-#ifdef TCGETS2
- if (!baud_rate) {
- struct termios2 tios2;
- if (ioctl(tty_fd, TCGETS2, &tios2) == 0) {
- if (inspeed) {
- tios2.c_cflag &= ~CBAUD;
- tios2.c_cflag |= BOTHER;
- tios2.c_ispeed = inspeed;
- tios2.c_ospeed = inspeed;
-#ifdef TCSETS2
- if (ioctl(tty_fd, TCSETS2, &tios2) == 0)
- baud_rate = inspeed;