Clean up main

This commit is contained in:
Martin Lund 2022-06-16 18:16:41 +02:00
parent 1636a55b7e
commit a37ad26a88
2 changed files with 8 additions and 6 deletions

View file

@ -76,7 +76,9 @@ int main(int argc, char *argv[])
/* Create log file */
if (option.log)
{
log_open(option.log_filename);
}
/* Initialize ANSI text formatting (colors etc.) */
print_init_ansi_formatting();
@ -86,11 +88,16 @@ int main(int argc, char *argv[])
tio_printf("Press ctrl-t q to quit");
/* Open socket */
socket_configure();
if (option.socket)
{
socket_configure();
}
/* Connect to tty device */
if (option.no_autoconnect)
{
status = tty_connect();
}
else
{
/* Enter connect loop */

View file

@ -85,11 +85,6 @@ void socket_configure(void)
struct sockaddr *sockaddr_p;
socklen_t socklen;
if (!option.socket)
{
return;
}
/* Parse socket string */
if (strncmp(option.socket, "unix:", 5) == 0)