← Commit list

64974793b

Denis Vlasenko
Denis Vlasenko
2008-10-31
FAILED Duration: 32s

Subject

less: fix newly-introduced case of less spinning forever on pty's closed etc

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

miscutils/less.c+10 -6
@@ -853,12 +853,16 @@ static ssize_t getch_nowait(void)
/* We have kbd_fd in O_NONBLOCK mode, read inside read_key()
* would not block even if there is no input available */
rd = read_key(kbd_fd, NULL, input);
- if (rd == -1 && errno == EAGAIN) {
- /* No keyboard input available. Since poll() did return,
- * we should have input on stdin */
- read_lines();
- buffer_fill_and_print();
- goto again;
+ if (rd == -1) {
+ if (errno == EAGAIN) {
+ /* No keyboard input available. Since poll() did return,
+ * we should have input on stdin */
+ read_lines();
+ buffer_fill_and_print();
+ goto again;
+ }
+ /* EOF/error (ssh session got killed etc) */
+ less_exit(0);
}
set_tty_cooked();
return rd;