mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-10-29 05:40:27 -04:00 
			
		
		
		
	Merge branch 'pulse_server_sd_socket_log' into 'master'
Draft: pulse-server: add more logging related to systemd socket activation See merge request pipewire/pipewire!2103
This commit is contained in:
		
						commit
						0ab83d0684
					
				
					 1 changed files with 11 additions and 4 deletions
				
			
		|  | @ -580,21 +580,26 @@ static bool is_stale_socket(int fd, const struct sockaddr_un *addr_un) | ||||||
| #ifdef HAVE_SYSTEMD | #ifdef HAVE_SYSTEMD | ||||||
| static int check_systemd_activation(const char *path) | static int check_systemd_activation(const char *path) | ||||||
| { | { | ||||||
| 	const int n = sd_listen_fds(0); | 	const int n = sd_listen_fds(false); | ||||||
|  | 	if (n < 0) | ||||||
|  | 		return n; | ||||||
| 
 | 
 | ||||||
| 	for (int i = 0; i < n; i++) { | 	for (int i = 0; i < n; i++) { | ||||||
| 		const int fd = SD_LISTEN_FDS_START + i; | 		const int fd = SD_LISTEN_FDS_START + i; | ||||||
| 
 | 
 | ||||||
| 		if (sd_is_socket_unix(fd, SOCK_STREAM, 1, path, 0) > 0) | 		int res = sd_is_socket_unix(fd, SOCK_STREAM, true, path, 0); | ||||||
|  | 		pw_log_debug("sd_is_socket_unix(%d, \"%s\"): %d", fd, path, res); | ||||||
|  | 
 | ||||||
|  | 		if (res > 0) | ||||||
| 			return fd; | 			return fd; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	return -1; | 	return -ENOENT; | ||||||
| } | } | ||||||
| #else | #else | ||||||
| static inline int check_systemd_activation(SPA_UNUSED const char *path) | static inline int check_systemd_activation(SPA_UNUSED const char *path) | ||||||
| { | { | ||||||
| 	return -1; | 	return -EOPNOTSUPP; | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  | @ -614,6 +619,8 @@ static int start_unix_server(struct server *server, const struct sockaddr_storag | ||||||
| 		goto done; | 		goto done; | ||||||
| 	} | 	} | ||||||
| 	else { | 	else { | ||||||
|  | 		pw_log_debug("server %p: no systemd socket activation socket found for '%s': %s", | ||||||
|  | 			     server, addr_un->sun_path, spa_strerror(fd)); | ||||||
| 		server->activated = false; | 		server->activated = false; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Barnabás Pőcze
						Barnabás Pőcze