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