mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Switch a fprintf to a fatal, and wrap some long lines.
This commit is contained in:
		
							
								
								
									
										13
									
								
								client.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								client.c
									
									
									
									
									
								
							@@ -303,11 +303,8 @@ 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)
 | 
				
			||||||
			fprintf(stderr, "tcgetattr failed: %s\n",
 | 
								fatal("tcgetattr failed");
 | 
				
			||||||
			    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;
 | 
				
			||||||
@@ -389,7 +386,8 @@ client_send_identify(const char *ttynam, const char *cwd)
 | 
				
			|||||||
		s = "";
 | 
							s = "";
 | 
				
			||||||
	proc_send(client_peer, MSG_IDENTIFY_TERM, -1, s, strlen(s) + 1);
 | 
						proc_send(client_peer, MSG_IDENTIFY_TERM, -1, s, strlen(s) + 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	proc_send(client_peer, MSG_IDENTIFY_TTYNAME, -1, ttynam, strlen(ttynam) + 1);
 | 
						proc_send(client_peer, MSG_IDENTIFY_TTYNAME, -1, ttynam,
 | 
				
			||||||
 | 
						    strlen(ttynam) + 1);
 | 
				
			||||||
	proc_send(client_peer, MSG_IDENTIFY_CWD, -1, cwd, strlen(cwd) + 1);
 | 
						proc_send(client_peer, MSG_IDENTIFY_CWD, -1, cwd, strlen(cwd) + 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ((fd = dup(STDIN_FILENO)) == -1)
 | 
						if ((fd = dup(STDIN_FILENO)) == -1)
 | 
				
			||||||
@@ -401,7 +399,8 @@ client_send_identify(const char *ttynam, const char *cwd)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	for (ss = environ; *ss != NULL; ss++) {
 | 
						for (ss = environ; *ss != NULL; ss++) {
 | 
				
			||||||
		sslen = strlen(*ss) + 1;
 | 
							sslen = strlen(*ss) + 1;
 | 
				
			||||||
		if (sslen <= MAX_IMSGSIZE - IMSG_HEADER_SIZE)
 | 
							if (sslen > MAX_IMSGSIZE - IMSG_HEADER_SIZE)
 | 
				
			||||||
 | 
								continue;
 | 
				
			||||||
		proc_send(client_peer, MSG_IDENTIFY_ENVIRON, -1, *ss, sslen);
 | 
							proc_send(client_peer, MSG_IDENTIFY_ENVIRON, -1, *ss, sslen);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user