From 61d17588149df64e54734330103ebe0622a8caa0 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 27 Feb 2021 13:21:06 +0100 Subject: feh_event_handle_stdin: handle EOF Closes #595 --- src/keyevents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/keyevents.c b/src/keyevents.c index a5526a2..0ca489a 100644 --- a/src/keyevents.c +++ b/src/keyevents.c @@ -319,7 +319,7 @@ void feh_event_handle_stdin() char stdin_buf[2]; static char is_esc = 0; KeySym keysym = NoSymbol; - if (read(STDIN_FILENO, &stdin_buf, 1) == -1) { + if (read(STDIN_FILENO, &stdin_buf, 1) <= 0) { control_via_stdin = 0; if (isatty(STDIN_FILENO) && getpgrp() == (tcgetpgrp(STDIN_FILENO))) { weprintf("reading a command from stdin failed - disabling control via stdin"); -- cgit v1.2.3