From f428edbd1945e9464896fa65c795563ca346d47f Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 17 Jul 2018 17:30:11 +0200 Subject: feh_main_iteration: Properly check select() return value Trying to handle stdin when select() in fact returned an error due to being interrupted by a signal is a rather bad idea. --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index 99397fd..1a76e2d 100644 --- a/src/main.c +++ b/src/main.c @@ -191,7 +191,7 @@ int feh_main_iteration(int block) in that */ feh_handle_timer(); } - else if (count && (FD_ISSET(0, &fdset))) + else if ((count > 0) && (FD_ISSET(0, &fdset))) feh_event_handle_stdin(); } } else { @@ -204,7 +204,7 @@ int feh_main_iteration(int block) && ((errno == ENOMEM) || (errno == EINVAL) || (errno == EBADF))) eprintf("Connection to X display lost"); - else if (count && (FD_ISSET(0, &fdset))) + else if ((count > 0) && (FD_ISSET(0, &fdset))) feh_event_handle_stdin(); } } -- cgit v1.2.3