mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Print error rather than fatal() if tcgetattr() fails, which is much more
useful to user.
This commit is contained in:
		
							
								
								
									
										7
									
								
								client.c
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								client.c
									
									
									
									
									
								
							@@ -313,8 +313,11 @@ client_main(struct event_base *base, int argc, char **argv, int flags,
 | 
				
			|||||||
	event_set(&client_stdin, STDIN_FILENO, EV_READ|EV_PERSIST,
 | 
						event_set(&client_stdin, STDIN_FILENO, EV_READ|EV_PERSIST,
 | 
				
			||||||
	    client_stdin_callback, NULL);
 | 
						    client_stdin_callback, NULL);
 | 
				
			||||||
	if (client_flags & CLIENT_CONTROLCONTROL) {
 | 
						if (client_flags & CLIENT_CONTROLCONTROL) {
 | 
				
			||||||
		if (tcgetattr(STDIN_FILENO, &saved_tio) != 0)
 | 
							if (tcgetattr(STDIN_FILENO, &saved_tio) != 0) {
 | 
				
			||||||
			fatal("tcgetattr failed");
 | 
								fprintf(stderr, "tcgetattr failed: %s\n",
 | 
				
			||||||
 | 
								    strerror(errno));
 | 
				
			||||||
 | 
								return (1);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		cfmakeraw(&tio);
 | 
							cfmakeraw(&tio);
 | 
				
			||||||
		tio.c_iflag = ICRNL|IXANY;
 | 
							tio.c_iflag = ICRNL|IXANY;
 | 
				
			||||||
		tio.c_oflag = OPOST|ONLCR;
 | 
							tio.c_oflag = OPOST|ONLCR;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user