summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/color.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/color.c')
-rw-r--r--tools/perf/util/color.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/color.c b/tools/perf/util/color.c
index e191eb9a667..521c38a7919 100644
--- a/tools/perf/util/color.c
+++ b/tools/perf/util/color.c
@@ -200,7 +200,7 @@ static int __color_vfprintf(FILE *fp, const char *color, const char *fmt,
* Auto-detect:
*/
if (perf_use_color_default < 0) {
- if (isatty(1) || pager_in_use())
+ if (isatty(fileno(fp)) || pager_in_use())
perf_use_color_default = 1;
else
perf_use_color_default = 0;