From 9f7eb63486387ae20cb1429e84e4169c6a9eaece Mon Sep 17 00:00:00 2001 From: AMG Date: Wed, 24 Jun 2026 18:33:09 +0200 Subject: [PATCH] refactor: pr --- src/tools/pw-container.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tools/pw-container.c b/src/tools/pw-container.c index fd0c4e470..e2fc102aa 100644 --- a/src/tools/pw-container.c +++ b/src/tools/pw-container.c @@ -155,7 +155,7 @@ int main(int argc, char *argv[]) struct spa_error_location loc; int c, res, listen_fd, close_fd[2]; char temp[] = "/tmp/pipewire-XXXXXX"; - const char *socket_path = temp; + const char *socket_path = NULL; struct sockaddr_un sockaddr = {0}; data.props = pw_properties_new( @@ -243,7 +243,6 @@ int main(int argc, char *argv[]) } if (opt_socket_path) { - unlink(opt_socket_path); socket_path = opt_socket_path; } else { res = mkstemp(temp); @@ -252,9 +251,11 @@ int main(int argc, char *argv[]) return -1; } close(res); - unlink(temp); + socket_path = temp; } + unlink(socket_path); + listen_fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0); if (listen_fd < 0) { fprintf(stderr, "can't make unix socket: %m\n");