1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-15 23:53:25 +00:00

Apply termios settings in a single system call (for ispeed,ospeed)

This commit is contained in:
Gerhard Rieger 2018-01-20 14:04:42 +01:00
parent b5be579187
commit ebbe704423
5 changed files with 255 additions and 249 deletions

View file

@ -123,8 +123,8 @@ static int xioopen_readline(int argc, const char *argv[], struct opt *opts,
Read_history(xfd->stream.para.readline.history_file);
}
#if _WITH_TERMIOS
xiotermios_clrflag(xfd->stream.fd, 3, ICANON);
xiotermios_clrflag(xfd->stream.fd, 3, ECHO);
xiotermios_clrflag(xfd->stream.fd, 3, ICANON|ECHO);
xiotermios_flush(xfd->stream.fd);
#endif /* _WITH_TERMIOS */
return _xio_openlate(&xfd->stream, opts);
}
@ -174,6 +174,7 @@ ssize_t xioread_readline(struct single *pipe, void *buff, size_t bufsiz) {
#if _WITH_TERMIOS
xiotermios_setflag(pipe->fd, 3, ECHO);
xiotermios_flush(pipe->fd);
#endif /* _WITH_TERMIOS */
if (pipe->para.readline.prompt || pipe->para.readline.dynprompt) {
/* we must carriage return, because readline will first print the
@ -201,6 +202,7 @@ ssize_t xioread_readline(struct single *pipe, void *buff, size_t bufsiz) {
}
#if _WITH_TERMIOS
xiotermios_clrflag(pipe->fd, 3, ECHO);
xiotermios_flush(pipe->fd);
#endif /* _WITH_TERMIOS */
Add_history(line);
bytes = strlen(line);