mirror of
https://github.com/tio/tio.git
synced 2026-05-01 23:07:58 +02:00
Cleanup
This commit is contained in:
parent
3d65e62e52
commit
c82b7e2ecc
1 changed files with 3 additions and 7 deletions
10
src/tty.c
10
src/tty.c
|
|
@ -664,15 +664,11 @@ int tty_connect(void)
|
||||||
static char previous_char = 0;
|
static char previous_char = 0;
|
||||||
static bool first = true;
|
static bool first = true;
|
||||||
int status;
|
int status;
|
||||||
bool next_timestamp = false;
|
bool next_timestamp = false;
|
||||||
char* now = NULL;
|
char* now = NULL;
|
||||||
|
|
||||||
/* Open tty device */
|
/* Open tty device */
|
||||||
#ifdef __APPLE__
|
fd = open(option.tty_device, O_RDWR | O_NOCTTY | O_NONBLOCK);
|
||||||
fd = open(option.tty_device, O_RDWR | O_NOCTTY | O_NONBLOCK );
|
|
||||||
#else
|
|
||||||
fd = open(option.tty_device, O_RDWR | O_NOCTTY);
|
|
||||||
#endif
|
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
{
|
{
|
||||||
error_printf_silent("Could not open tty device (%s)", strerror(errno));
|
error_printf_silent("Could not open tty device (%s)", strerror(errno));
|
||||||
|
|
@ -789,7 +785,7 @@ int tty_connect(void)
|
||||||
/* Update receive statistics */
|
/* Update receive statistics */
|
||||||
rx_total++;
|
rx_total++;
|
||||||
|
|
||||||
/* Print timestamp on new line, if desired. */
|
/* Print timestamp on new line if enabled */
|
||||||
if (next_timestamp && input_char != '\n' && input_char != '\r')
|
if (next_timestamp && input_char != '\n' && input_char != '\r')
|
||||||
{
|
{
|
||||||
now = current_time();
|
now = current_time();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue