diff options
Diffstat (limited to 'utils.c')
-rw-r--r-- | utils.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -150,6 +150,21 @@ int setup_tty(int fd, speed_t speed) return ret; } +// tmio.c_iflag |= ; + tmio.c_iflag &= ~(INLCR | ICRNL | IGNCR | IXON | IXOFF); + +// tmio.c_oflag |= ; + tmio.c_oflag &= ~(ONLCR | OCRNL | ONOCR | ONLRET); + + tmio.c_cflag |= CS8 | CLOCAL | CREAD; + tmio.c_cflag &= ~(CSTOPB | PARENB); + +// tmio.c_lflag |= ; + tmio.c_lflag &= ~(ICANON | ECHO); + + tmio.c_cc[VTIME] = 0; + tmio.c_cc[VMIN] = 1; + ret = cfsetospeed(&tmio, speed); if(ret) { log_printf(ERROR, "Error on cfsetospeed(): %s", strerror(errno)); @@ -162,8 +177,6 @@ int setup_tty(int fd, speed_t speed) return ret; } - tmio.c_lflag &= ~ECHO; - ret = tcsetattr(fd, TCSANOW, &tmio); if(ret) { log_printf(ERROR, "Error on tcsetattr(): %s", strerror(errno)); |