summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-07-17 17:30:11 +0200
committerDaniel Friesel <derf@finalrewind.org>2018-07-17 17:30:11 +0200
commitf428edbd1945e9464896fa65c795563ca346d47f (patch)
tree9cb90fdd58baaa81402ca7b2a7165d72dbfc9e10
parent171ebcfe02f87212fd8d2080bcc6217e5962955b (diff)
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.
-rw-r--r--src/main.c4
1 files changed, 2 insertions, 2 deletions
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();
}
}