mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Do not close stdout file descriptor in control mode since it will be needed for
printing the exit messages.
This commit is contained in:
		
							
								
								
									
										5
									
								
								client.c
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								client.c
									
									
									
									
									
								
							@@ -520,7 +520,7 @@ client_write_open(void *data, size_t datalen)
 | 
			
		||||
			errno = EBADF;
 | 
			
		||||
		else {
 | 
			
		||||
			cf->fd = dup(msg->fd);
 | 
			
		||||
			if (client_flags & CLIENT_CONTROL)
 | 
			
		||||
			if (~client_flags & CLIENT_CONTROL)
 | 
			
		||||
				close(msg->fd); /* can only be used once */
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
@@ -675,7 +675,8 @@ client_read_open(void *data, size_t datalen)
 | 
			
		||||
			errno = EBADF;
 | 
			
		||||
		else {
 | 
			
		||||
			cf->fd = dup(msg->fd);
 | 
			
		||||
			close(msg->fd); /* can only be used once */
 | 
			
		||||
			if (~client_flags & CLIENT_CONTROL)
 | 
			
		||||
				close(msg->fd); /* can only be used once */
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	if (cf->fd == -1) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user