diff options
-rw-r--r-- | tools/power/acpi/os_specific/service_layers/osunixxf.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/power/acpi/os_specific/service_layers/osunixxf.c b/tools/power/acpi/os_specific/service_layers/osunixxf.c index 60b58cd18410..7ccb073f8316 100644 --- a/tools/power/acpi/os_specific/service_layers/osunixxf.c +++ b/tools/power/acpi/os_specific/service_layers/osunixxf.c | |||
@@ -122,6 +122,14 @@ static void os_enter_line_edit_mode(void) | |||
122 | { | 122 | { |
123 | struct termios local_term_attributes; | 123 | struct termios local_term_attributes; |
124 | 124 | ||
125 | term_attributes_were_set = 0; | ||
126 | |||
127 | /* STDIN must be a terminal */ | ||
128 | |||
129 | if (!isatty(STDIN_FILENO)) { | ||
130 | return; | ||
131 | } | ||
132 | |||
125 | /* Get and keep the original attributes */ | 133 | /* Get and keep the original attributes */ |
126 | 134 | ||
127 | if (tcgetattr(STDIN_FILENO, &original_term_attributes)) { | 135 | if (tcgetattr(STDIN_FILENO, &original_term_attributes)) { |