- goto unlock_and_exit;
- fcntl(sfd, F_SETFL, O_RDWR | O_NOCTTY);
-
- /* put stdin to "raw mode" (if stdin is a TTY),
- handle one character at a time */
- istty = isatty(STDIN_FILENO);
- if (istty) {
- xget1(STDIN_FILENO, &tio, &tio0);
- if (xset1(STDIN_FILENO, &tio, "stdin"))
- goto close_unlock_and_exit;
-// tcflush(STDIN_FILENO, TCIFLUSH);
- timeout = -1; // tty input? -> set infinite timeout for poll()
- }