mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	FIX: Suprocess loops endlessly when the control socket closes.
recvmsg(3) returns 0 if the connection partner has shut down its socket. The communicate function considered 0 a successful message, though, and keeps calling recvmsg(3) again and again.
This commit is contained in:
		
							parent
							
								
									cc89906ddf
								
							
						
					
					
						commit
						482fc48c74
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -130,7 +130,7 @@ static void communicate(int sock) {
 | 
			
		|||
	int drm_fd = -1;
 | 
			
		||||
	bool running = true;
 | 
			
		||||
 | 
			
		||||
	while (running && recv_msg(sock, &drm_fd, &msg, sizeof(msg)) >= 0) {
 | 
			
		||||
	while (running && recv_msg(sock, &drm_fd, &msg, sizeof(msg)) > 0) {
 | 
			
		||||
		switch (msg.type) {
 | 
			
		||||
		case MSG_OPEN:
 | 
			
		||||
			errno = 0;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue