mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
[interlink] do not nest retries for connect_to_af_unix(), it has already
Not sure why a retry loop using MAX_BIND_TRIES / BIND_TRIES_DELAY surrounds connect_to_af_unix(), since bind() is done elsewhere in the code, and connect_to_af_unix() already has its own retry loop inside the function, with its own set of defines for retries, i.e. MAX_CONNECT_TRIES / CONNECT_TRIES_DELAY, surrounding the connect(). No need to have two levels of retry; if it's not successful within connect_to_af_unix() it will never be.
This commit is contained in:
parent
86b621966e
commit
b482b9e069
@ -530,19 +530,10 @@ init_interlink(void)
|
|||||||
if (pid == -1) return -1;
|
if (pid == -1) return -1;
|
||||||
|
|
||||||
if (pid > 0) {
|
if (pid > 0) {
|
||||||
int i;
|
master_pid = pid;
|
||||||
|
return connect_to_af_unix();
|
||||||
for (i = 1; i <= (MAX_BIND_TRIES+2); ++i) {
|
|
||||||
fd = connect_to_af_unix();
|
|
||||||
|
|
||||||
if (fd != -1) {
|
|
||||||
master_pid = pid;
|
|
||||||
return fd;
|
|
||||||
}
|
|
||||||
elinks_usleep(BIND_TRIES_DELAY * i);
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* child */
|
/* child */
|
||||||
master_pid = getpid();
|
master_pid = getpid();
|
||||||
close_terminal_pipes();
|
close_terminal_pipes();
|
||||||
|
Loading…
Reference in New Issue
Block a user