mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 16:46:18 +00:00 
			
		
		
		
	Call waitpid on SIGCHLD even if client not attached, it is possible (on
very slow platforms) for the first daemon() child to still be running when client_attached is set so we end up with a zombie. From J Raynor.
This commit is contained in:
		
							
								
								
									
										12
									
								
								client.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								client.c
									
									
									
									
									
								
							@@ -433,15 +433,11 @@ client_signal(int sig, unused short events, unused void *data)
 | 
			
		||||
	struct sigaction sigact;
 | 
			
		||||
	int		 status;
 | 
			
		||||
 | 
			
		||||
	if (!client_attached) {
 | 
			
		||||
		switch (sig) {
 | 
			
		||||
		case SIGCHLD:
 | 
			
		||||
			waitpid(WAIT_ANY, &status, WNOHANG);
 | 
			
		||||
			break;
 | 
			
		||||
		case SIGTERM:
 | 
			
		||||
	if (sig == SIGCHLD)
 | 
			
		||||
		waitpid(WAIT_ANY, &status, WNOHANG);
 | 
			
		||||
	else if (!client_attached) {
 | 
			
		||||
		if (sig == SIGTERM)
 | 
			
		||||
			event_loopexit(NULL);
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
	} else {
 | 
			
		||||
		switch (sig) {
 | 
			
		||||
		case SIGHUP:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user