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 @@ -1126,12 +1126,9 @@ static void frr_terminal_close(int isexit)
1126
1126
* don't redirect when stdout is set with --log stdout
1127
1127
*/
1128
1128
for (fd = 2 ; fd >= 0 ; fd -- )
1129
- if (logging_to_stdout && isatty (fd ) &&
1130
- fd == STDOUT_FILENO ) {
1131
- /* Do nothing. */
1132
- } else {
1129
+ if (isatty (fd ) &&
1130
+ (fd != STDOUT_FILENO || !logging_to_stdout ))
1133
1131
dup2 (nullfd , fd );
1134
- }
1135
1132
close (nullfd );
1136
1133
}
1137
1134
}
@@ -1217,12 +1214,9 @@ void frr_run(struct event_loop *master)
1217
1214
* stdout
1218
1215
*/
1219
1216
for (fd = 2 ; fd >= 0 ; fd -- )
1220
- if (logging_to_stdout && isatty (fd ) &&
1221
- fd == STDOUT_FILENO ) {
1222
- /* Do nothing. */
1223
- } else {
1217
+ if (isatty (fd ) &&
1218
+ (fd != STDOUT_FILENO || !logging_to_stdout ))
1224
1219
dup2 (nullfd , fd );
1225
- }
1226
1220
close (nullfd );
1227
1221
}
1228
1222
You can’t perform that action at this time.
0 commit comments