mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-05 09:51:53 +00:00
Revert "lib: Attach stdout to child only if --log=stdout and stdout FD is a tty"
This reverts commit0e3c5e8e59
. (cherry picked from commit6a36b9ef49
)
This commit is contained in:
parent
0401930508
commit
cbeb51ca2c
14
lib/libfrr.c
14
lib/libfrr.c
@ -1115,12 +1115,9 @@ static void frr_terminal_close(int isexit)
|
||||
* don't redirect when stdout is set with --log stdout
|
||||
*/
|
||||
for (fd = 2; fd >= 0; fd--)
|
||||
if (logging_to_stdout && isatty(fd) &&
|
||||
fd == STDOUT_FILENO) {
|
||||
/* Do nothing. */
|
||||
} else {
|
||||
if (isatty(fd) &&
|
||||
(fd != STDOUT_FILENO || !logging_to_stdout))
|
||||
dup2(nullfd, fd);
|
||||
}
|
||||
close(nullfd);
|
||||
}
|
||||
}
|
||||
@ -1206,12 +1203,9 @@ void frr_run(struct event_loop *master)
|
||||
* stdout
|
||||
*/
|
||||
for (fd = 2; fd >= 0; fd--)
|
||||
if (logging_to_stdout && isatty(fd) &&
|
||||
fd == STDOUT_FILENO) {
|
||||
/* Do nothing. */
|
||||
} else {
|
||||
if (isatty(fd) &&
|
||||
(fd != STDOUT_FILENO || !logging_to_stdout))
|
||||
dup2(nullfd, fd);
|
||||
}
|
||||
close(nullfd);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user