Skip to content

Commit

Permalink
Revert "lib: Attach stdout to child only if --log=stdout and stdout F…
Browse files Browse the repository at this point in the history
…D is a tty"

This reverts commit 0e3c5e8.
  • Loading branch information
donaldsharp committed Oct 22, 2024
1 parent 98ec22f commit 6a36b9e
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 @@ -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);
}
}
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 6a36b9e

Please sign in to comment.