1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-07-26 16:45:12 -04:00

[interlink] Test commit. All terminals - slaves.

Before when master terminal quit session, all slave terminal stopped to work.
There is a workaround. ELinks on master terminal forks on start and becomes slave.
This commit is contained in:
Witold Filipczyk 2020-05-17 16:35:58 +02:00
parent 0c794c2200
commit 08138487a0
2 changed files with 17 additions and 1 deletions

View File

@ -515,9 +515,25 @@ int
init_interlink(void)
{
int fd = connect_to_af_unix();
int pid;
if (fd != -1) return fd;
pid = fork();
if (pid == -1) return -1;
if (pid > 0) {
int i;
for (i = 1; i <= (MAX_BIND_TRIES+2); ++i) {
fd = connect_to_af_unix();
if (fd != -1) return fd;
elinks_usleep(BIND_TRIES_DELAY * i);
}
return -1;
}
close_terminal_pipes();
bind_to_af_unix();
return -1;
}

View File

@ -235,7 +235,7 @@ init(void)
handle_trm(get_input_handle(), get_output_handle(),
fd, fd, get_ctl_handle(), info.source, info.length,
remote_session_flags);
} else {
} else if (get_cmd_opt_bool("no-connect")) {
/* Setup a master terminal */
term = attach_terminal(get_input_handle(), get_output_handle(),
get_ctl_handle(), info.source, info.length);