|
|
| version 1.19.4.3, 2025/12/17 23:29:37 | version 1.21.2.1, 2025/12/21 22:36:19 |
|---|---|
| Line 558 cli_Printf(linebuffer_t * __restrict cli_buffer, char | Line 558 cli_Printf(linebuffer_t * __restrict cli_buffer, char |
| FILE *f; | FILE *f; |
| if (fmt) { | if (fmt) { |
| f = fdopen(cli_buffer->line_out, "a"); | f = fdopen(dup(cli_buffer->line_out), "a"); |
| if (!f) { | if (!f) { |
| LOGERR; | LOGERR; |
| return; | return; |
| Line 1300 int | Line 1300 int |
| cliResetLine(linebuffer_t * __restrict cli_buffer, struct termios * __restrict orig) | cliResetLine(linebuffer_t * __restrict cli_buffer, struct termios * __restrict orig) |
| { | { |
| return tcsetattr(cli_buffer->line_in, TCSANOW, orig); | return tcsetattr(cli_buffer->line_in, TCSANOW, orig); |
| } | |
| /* | |
| * cliEcho() - Switch echo on or off | |
| * | |
| * @cli_buffer = CLI buffer | |
| * @on = On or off for echo on input handler | |
| * return: -1 error or 0 ok | |
| */ | |
| int | |
| cliEcho(linebuffer_t * __restrict cli_buffer, int on) | |
| { | |
| struct termios t; | |
| if (tcgetattr(cli_buffer->line_in, &t) == -1) { | |
| cli_SetErr(errno, "tcgetattr(%d) - %s", cli_buffer->line_in, strerror(errno)); | |
| return -1; | |
| } | |
| if (on) | |
| t.c_lflag |= (ECHO); | |
| else | |
| t.c_lflag &= ~(ECHO); | |
| return tcsetattr(cli_buffer->line_in, TCSANOW, &t); | |
| } | } |
| /* | /* |