mirror of
https://github.com/tio/tio.git
synced 2026-05-01 23:07:58 +02:00
Clean up main
This commit is contained in:
parent
1636a55b7e
commit
a37ad26a88
2 changed files with 8 additions and 6 deletions
|
|
@ -76,7 +76,9 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
/* Create log file */
|
/* Create log file */
|
||||||
if (option.log)
|
if (option.log)
|
||||||
|
{
|
||||||
log_open(option.log_filename);
|
log_open(option.log_filename);
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize ANSI text formatting (colors etc.) */
|
/* Initialize ANSI text formatting (colors etc.) */
|
||||||
print_init_ansi_formatting();
|
print_init_ansi_formatting();
|
||||||
|
|
@ -86,11 +88,16 @@ int main(int argc, char *argv[])
|
||||||
tio_printf("Press ctrl-t q to quit");
|
tio_printf("Press ctrl-t q to quit");
|
||||||
|
|
||||||
/* Open socket */
|
/* Open socket */
|
||||||
|
if (option.socket)
|
||||||
|
{
|
||||||
socket_configure();
|
socket_configure();
|
||||||
|
}
|
||||||
|
|
||||||
/* Connect to tty device */
|
/* Connect to tty device */
|
||||||
if (option.no_autoconnect)
|
if (option.no_autoconnect)
|
||||||
|
{
|
||||||
status = tty_connect();
|
status = tty_connect();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Enter connect loop */
|
/* Enter connect loop */
|
||||||
|
|
|
||||||
|
|
@ -85,11 +85,6 @@ void socket_configure(void)
|
||||||
struct sockaddr *sockaddr_p;
|
struct sockaddr *sockaddr_p;
|
||||||
socklen_t socklen;
|
socklen_t socklen;
|
||||||
|
|
||||||
if (!option.socket)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Parse socket string */
|
/* Parse socket string */
|
||||||
|
|
||||||
if (strncmp(option.socket, "unix:", 5) == 0)
|
if (strncmp(option.socket, "unix:", 5) == 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue