Skip to content

Commit

Permalink
Merge pull request FRRouting#17202 from FRRouting/mergify/bp/stable/1…
Browse files Browse the repository at this point in the history
…0.1/pr-17198

Revert "lib: Attach stdout to child only if --log=stdout and stdout F… (backport FRRouting#17198)
  • Loading branch information
ton31337 authored Oct 23, 2024
2 parents 0401930 + cbeb51c commit be50cd1
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions lib/libfrr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit be50cd1

Please sign in to comment.