diff options
| author | Daniel Friesel <derf@finalrewind.org> | 2018-07-17 17:30:11 +0200 | 
|---|---|---|
| committer | Daniel Friesel <derf@finalrewind.org> | 2018-07-17 17:30:11 +0200 | 
| commit | f428edbd1945e9464896fa65c795563ca346d47f (patch) | |
| tree | 9cb90fdd58baaa81402ca7b2a7165d72dbfc9e10 /src | |
| parent | 171ebcfe02f87212fd8d2080bcc6217e5962955b (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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.c | 4 | 
1 files changed, 2 insertions, 2 deletions
| @@ -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();  		}  	} | 
