diff --git a/src/modules/module-protocol-pulse/server.c b/src/modules/module-protocol-pulse/server.c index 4e744e33f..f1b9f02e4 100644 --- a/src/modules/module-protocol-pulse/server.c +++ b/src/modules/module-protocol-pulse/server.c @@ -580,21 +580,26 @@ static bool is_stale_socket(int fd, const struct sockaddr_un *addr_un) #ifdef HAVE_SYSTEMD 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++) { 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 -1; + return -ENOENT; } #else static inline int check_systemd_activation(SPA_UNUSED const char *path) { - return -1; + return -EOPNOTSUPP; } #endif @@ -614,6 +619,8 @@ static int start_unix_server(struct server *server, const struct sockaddr_storag goto done; } 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; }