mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 16:46:18 +00:00 
			
		
		
		
	Delete input event when evbuffer_read() fails to avoid just spinning
around a dead file descriptor. Seems to fix a problem reported by Greg Hurrell in GitHub issue 941.
This commit is contained in:
		
							
								
								
									
										4
									
								
								tty.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								tty.c
									
									
									
									
									
								
							@@ -159,8 +159,10 @@ tty_read_callback(__unused int fd, __unused short events, void *data)
 | 
			
		||||
	int		 nread;
 | 
			
		||||
 | 
			
		||||
	nread = evbuffer_read(tty->in, tty->fd, -1);
 | 
			
		||||
	if (nread == -1)
 | 
			
		||||
	if (nread == -1) {
 | 
			
		||||
		event_del(&tty->event_in);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	log_debug("%s: read %d bytes (already %zu)", c->name, nread, size);
 | 
			
		||||
 | 
			
		||||
	while (tty_keys_next(tty))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user