]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
rtla: use the definition for stdout fd when calling isatty()
authorEder Zulian <ezulian@redhat.com>
Tue, 13 Aug 2024 14:23:38 +0000 (16:23 +0200)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Fri, 4 Oct 2024 17:42:22 +0000 (13:42 -0400)
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>
tools/tracing/rtla/src/osnoise_top.c
tools/tracing/rtla/src/timerlat_top.c

index 2f756628613dd82d86a22e1e17752c7e3f36c941..66e3a4382bc2fd090377f8002228555fd53a5138 100644 (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;
index 8c16419fe22aa7b7791fb144932ca4f79be97583..94a2f5bbaeb7bfd207f9c32f5d6988d21c7d35c4 100644 (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;