dont show line state if ioctl failed

This commit is contained in:
George Stark 2019-09-19 17:39:01 +03:00
parent 04d92740f5
commit 5217d9842b

View file

@ -144,9 +144,11 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c
case KEY_SHIFT_L:
if (ioctl(fd, TIOCMGET, &state) < 0)
{
error_printf("Could not get line state: %s", strerror(errno));
break;
}
tio_printf("Lines state:");
tio_printf(" DTR: %s", (state & TIOCM_DTR) ? "HIGH" : "LOW");
tio_printf(" RTS: %s", (state & TIOCM_RTS) ? "HIGH" : "LOW");
tio_printf(" CTS: %s", (state & TIOCM_CTS) ? "HIGH" : "LOW");