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/20240813142338.376039-1-ezulian@redhat.com
Signed-off-by: Eder Zulian <ezulian@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
This commit is contained in:
Eder Zulian 2024-08-13 16:23:38 +02:00 committed by Steven Rostedt (Google)
parent 9852d85ec9
commit 3a546a67a4
2 changed files with 2 additions and 2 deletions

View File

@ -627,7 +627,7 @@ osnoise_top_apply_config(struct osnoise_tool *tool, struct osnoise_top_params *p
auto_house_keeping(&params->monitored_cpus);
}
if (isatty(1) && !params->quiet)
if (isatty(STDOUT_FILENO) && !params->quiet)
params->pretty_output = 1;
return 0;

View File

@ -850,7 +850,7 @@ timerlat_top_apply_config(struct osnoise_tool *top, struct timerlat_top_params *
}
}
if (isatty(1) && !params->quiet)
if (isatty(STDOUT_FILENO) && !params->quiet)
params->pretty_output = 1;
return 0;