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 @@ -1115,12 +1115,9 @@ static void frr_terminal_close(int isexit)
1115
1115
* don't redirect when stdout is set with --log stdout
1116
1116
*/
1117
1117
for (fd = 2 ; fd >= 0 ; fd -- )
1118
- if (logging_to_stdout && isatty (fd ) &&
1119
- fd == STDOUT_FILENO ) {
1120
- /* Do nothing. */
1121
- } else {
1118
+ if (isatty (fd ) &&
1119
+ (fd != STDOUT_FILENO || !logging_to_stdout ))
1122
1120
dup2 (nullfd , fd );
1123
- }
1124
1121
close (nullfd );
1125
1122
}
1126
1123
}
@@ -1206,12 +1203,9 @@ void frr_run(struct event_loop *master)
1206
1203
* stdout
1207
1204
*/
1208
1205
for (fd = 2 ; fd >= 0 ; fd -- )
1209
- if (logging_to_stdout && isatty (fd ) &&
1210
- fd == STDOUT_FILENO ) {
1211
- /* Do nothing. */
1212
- } else {
1206
+ if (isatty (fd ) &&
1207
+ (fd != STDOUT_FILENO || !logging_to_stdout ))
1213
1208
dup2 (nullfd , fd );
1214
- }
1215
1209
close (nullfd );
1216
1210
}
1217
1211
You can’t perform that action at this time.
0 commit comments