mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	protocol-native: write socket address after adding
Only write the socket address after we managed to add the fd to the main loop. Only log a warning when this fails.
This commit is contained in:
		
							parent
							
								
									ced57514f4
								
							
						
					
					
						commit
						7af43d87b3
					
				
					 1 changed files with 5 additions and 6 deletions
				
			
		| 
						 | 
					@ -959,12 +959,6 @@ static int add_socket(struct pw_protocol *protocol, struct server *s, struct soc
 | 
				
			||||||
					s, info->name);
 | 
										s, info->name);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	res = write_socket_address(s);
 | 
					 | 
				
			||||||
	if (res < 0) {
 | 
					 | 
				
			||||||
		pw_log_error("server %p: failed to write socket address: %s", s,
 | 
					 | 
				
			||||||
				spa_strerror(res));
 | 
					 | 
				
			||||||
		goto error_close;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	s->activated = activated;
 | 
						s->activated = activated;
 | 
				
			||||||
	s->loop = pw_context_get_main_loop(protocol->context);
 | 
						s->loop = pw_context_get_main_loop(protocol->context);
 | 
				
			||||||
	if (s->loop == NULL) {
 | 
						if (s->loop == NULL) {
 | 
				
			||||||
| 
						 | 
					@ -976,6 +970,11 @@ static int add_socket(struct pw_protocol *protocol, struct server *s, struct soc
 | 
				
			||||||
		res = -errno;
 | 
							res = -errno;
 | 
				
			||||||
		goto error_close;
 | 
							goto error_close;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						res = write_socket_address(s);
 | 
				
			||||||
 | 
						if (res < 0) {
 | 
				
			||||||
 | 
							pw_log_warn("server %p: failed to write socket address: %s", s,
 | 
				
			||||||
 | 
									spa_strerror(res));
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
error_close:
 | 
					error_close:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue