File tree 1 file changed +4
-10
lines changed
1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -1108,12 +1108,9 @@ static void frr_terminal_close(int isexit)
1108
1108
* don't redirect when stdout is set with --log stdout
1109
1109
*/
1110
1110
for (fd = 2 ; fd >= 0 ; fd -- )
1111
- if (logging_to_stdout && isatty (fd ) &&
1112
- fd == STDOUT_FILENO ) {
1113
- /* Do nothing. */
1114
- } else {
1111
+ if (isatty (fd ) &&
1112
+ (fd != STDOUT_FILENO || !logging_to_stdout ))
1115
1113
dup2 (nullfd , fd );
1116
- }
1117
1114
close (nullfd );
1118
1115
}
1119
1116
}
@@ -1199,12 +1196,9 @@ void frr_run(struct event_loop *master)
1199
1196
* stdout
1200
1197
*/
1201
1198
for (fd = 2 ; fd >= 0 ; fd -- )
1202
- if (logging_to_stdout && isatty (fd ) &&
1203
- fd == STDOUT_FILENO ) {
1204
- /* Do nothing. */
1205
- } else {
1199
+ if (isatty (fd ) &&
1200
+ (fd != STDOUT_FILENO || !logging_to_stdout ))
1206
1201
dup2 (nullfd , fd );
1207
- }
1208
1202
close (nullfd );
1209
1203
}
1210
1204
You can’t perform that action at this time.
0 commit comments