diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-02-27 13:21:06 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-02-27 13:21:06 +0100 |
commit | 61d17588149df64e54734330103ebe0622a8caa0 (patch) | |
tree | b8bed9fe35e08b412a86d6629fe6f6d7ef224648 | |
parent | a1a47cf12c38b777e2d368363a85ccb5e94ded36 (diff) |
feh_event_handle_stdin: handle EOF
Closes #595
-rw-r--r-- | src/keyevents.c | 2 |
1 files changed, 1 insertions, 1 deletions
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"); |