Skip to content

Commit

Permalink
Merge pull request #17198 from donaldsharp/backout_stdout_changes
Browse files Browse the repository at this point in the history
Revert "lib: Attach stdout to child only if --log=stdout and stdout F…
  • Loading branch information
riw777 authored Oct 22, 2024
2 parents 8ccd538 + 6a36b9e commit a4ecc2f
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 a4ecc2f

Please sign in to comment.