Skip to content

Commit 3a546a6

Browse files
efzrhrostedt
authored andcommitted
rtla: use the definition for stdout fd when calling isatty()
Use the STDOUT_FILENO definition when testing whether the standard output file descriptor refers to a terminal (for better redability). Link: https://lore.kernel.org/[email protected] Signed-off-by: Eder Zulian <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 9852d85 commit 3a546a6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tools/tracing/rtla/src/osnoise_top.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ osnoise_top_apply_config(struct osnoise_tool *tool, struct osnoise_top_params *p
627627
auto_house_keeping(&params->monitored_cpus);
628628
}
629629

630-
if (isatty(1) && !params->quiet)
630+
if (isatty(STDOUT_FILENO) && !params->quiet)
631631
params->pretty_output = 1;
632632

633633
return 0;

tools/tracing/rtla/src/timerlat_top.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ timerlat_top_apply_config(struct osnoise_tool *top, struct timerlat_top_params *
850850
}
851851
}
852852

853-
if (isatty(1) && !params->quiet)
853+
if (isatty(STDOUT_FILENO) && !params->quiet)
854854
params->pretty_output = 1;
855855

856856
return 0;

0 commit comments

Comments
 (0)