linux/tools/power
Artem Bityutskiy 47936f944e tools/power turbostat: fix printing on input
The recent patch that implements table printing on a keypress introduced a
regression - turbostat prints the table almost continuously if it is run from a
daemon program.

The problem is also easy to reproduce like this:

echo | turbostat

The reason is that we cannot assume that stdin is always a TTY. It can be many
things.

This patch adds fixes the problem by limiting the new keypress functionality to
TTYs only. If stdin is not a TTY, we just sleep for the full interval time.

While on it, clean-up 'do_sleep()' to return no value, as callers do not expect
that anyway.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2018-06-01 12:13:05 -04:00
..
acpi tools: power/acpi, revert to LD = gcc 2018-05-04 11:24:22 +02:00
cpupower cpupower: Remove FSF address 2017-12-15 08:27:39 -07:00
pm-graph pm-graph: AnalyzeSuspend v5.0 2018-02-21 23:56:22 +01:00
x86 tools/power turbostat: fix printing on input 2018-06-01 12:13:05 -04:00