Merge tag 'renesas-boards-cleanups2-for-v3.19' of git://git.kernel.org/pub/scm/linux...
[firefly-linux-kernel-4.4.55.git] / tools / power / acpi / os_specific / service_layers / osunixxf.c
index 60b58cd18410e2406352d985215e525e94026f6a..7ccb073f8316d48b6136c60634465a0d9c67dc78 100644 (file)
@@ -122,6 +122,14 @@ static void os_enter_line_edit_mode(void)
 {
        struct termios local_term_attributes;
 
+       term_attributes_were_set = 0;
+
+       /* STDIN must be a terminal */
+
+       if (!isatty(STDIN_FILENO)) {
+               return;
+       }
+
        /* Get and keep the original attributes */
 
        if (tcgetattr(STDIN_FILENO, &original_term_attributes)) {