forked from Mirror/frr
Merge pull request #17198 from donaldsharp/backout_stdout_changes
Revert "lib: Attach stdout to child only if --log=stdout and stdout F…
This commit is contained in:
commit
a4ecc2f4d2
14
lib/libfrr.c
14
lib/libfrr.c
|
@ -1126,12 +1126,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);
|
||||
}
|
||||
}
|
||||
|
@ -1217,12 +1214,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 a new issue