mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Cleanup stdout flushing
Flushing is not needed since we disabled buffering of stdout.
This commit is contained in:
parent
4c611e6767
commit
a0f3f9d9b7
4 changed files with 1 additions and 11 deletions
|
|
@ -175,7 +175,6 @@ void log_close(void)
|
|||
{
|
||||
if (fp != NULL)
|
||||
{
|
||||
fflush(fp);
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,14 +30,11 @@ char ansi_format[30];
|
|||
void print_hex(char c)
|
||||
{
|
||||
printf("%02x ", (unsigned char) c);
|
||||
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
void print_normal(char c)
|
||||
{
|
||||
putchar(c);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
void print_init_ansi_formatting()
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ extern char ansi_format[];
|
|||
fprintf (stdout, "\r" format "\r\n", ## args); \
|
||||
else \
|
||||
fprintf (stdout, "\r%s" format ANSI_RESET "\r\n", ansi_format, ## args); \
|
||||
fflush(stdout); \
|
||||
}
|
||||
|
||||
#define ansi_error_printf(format, args...) \
|
||||
|
|
@ -55,7 +54,6 @@ extern char ansi_format[];
|
|||
fprintf (stdout, format, ## args); \
|
||||
else \
|
||||
fprintf (stdout, "%s" format ANSI_RESET, ansi_format, ## args); \
|
||||
fflush(stdout); \
|
||||
}
|
||||
|
||||
#define warning_printf(format, args...) \
|
||||
|
|
@ -66,7 +64,6 @@ extern char ansi_format[];
|
|||
fprintf (stdout, "\r[%s] Warning: " format "\r\n", current_time(), ## args); \
|
||||
else \
|
||||
ansi_printf("[%s] Warning: " format, current_time(), ## args); \
|
||||
fflush(stdout); \
|
||||
}
|
||||
|
||||
#define tio_printf(format, args...) \
|
||||
|
|
|
|||
|
|
@ -86,7 +86,6 @@ static void optional_local_echo(char c)
|
|||
return;
|
||||
}
|
||||
print(c);
|
||||
fflush(stdout);
|
||||
if (option.log)
|
||||
{
|
||||
log_putc(c);
|
||||
|
|
@ -255,7 +254,6 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c
|
|||
case KEY_L:
|
||||
/* Clear screen using ANSI/VT100 escape code */
|
||||
printf("\033c");
|
||||
fflush(stdout);
|
||||
break;
|
||||
|
||||
case KEY_Q:
|
||||
|
|
@ -352,7 +350,7 @@ void stdout_configure(void)
|
|||
|
||||
/* Disable line buffering in stdout. This is necessary if we
|
||||
* want things like local echo to work correctly. */
|
||||
setbuf(stdout, NULL);
|
||||
setvbuf(stdout, NULL, _IONBF, 0);
|
||||
|
||||
/* Save current stdout settings */
|
||||
if (tcgetattr(STDOUT_FILENO, &stdout_old) < 0)
|
||||
|
|
@ -816,7 +814,6 @@ int tty_connect(void)
|
|||
/* Print received tty character to stdout */
|
||||
print(input_char);
|
||||
}
|
||||
fflush(stdout);
|
||||
|
||||
/* Write to log */
|
||||
if (option.log)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue