mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-06-30 13:14:16 -04:00
refactor: pr
This commit is contained in:
parent
b4b4e03816
commit
9f7eb63486
1 changed files with 4 additions and 3 deletions
|
|
@ -155,7 +155,7 @@ int main(int argc, char *argv[])
|
||||||
struct spa_error_location loc;
|
struct spa_error_location loc;
|
||||||
int c, res, listen_fd, close_fd[2];
|
int c, res, listen_fd, close_fd[2];
|
||||||
char temp[] = "/tmp/pipewire-XXXXXX";
|
char temp[] = "/tmp/pipewire-XXXXXX";
|
||||||
const char *socket_path = temp;
|
const char *socket_path = NULL;
|
||||||
struct sockaddr_un sockaddr = {0};
|
struct sockaddr_un sockaddr = {0};
|
||||||
|
|
||||||
data.props = pw_properties_new(
|
data.props = pw_properties_new(
|
||||||
|
|
@ -243,7 +243,6 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opt_socket_path) {
|
if (opt_socket_path) {
|
||||||
unlink(opt_socket_path);
|
|
||||||
socket_path = opt_socket_path;
|
socket_path = opt_socket_path;
|
||||||
} else {
|
} else {
|
||||||
res = mkstemp(temp);
|
res = mkstemp(temp);
|
||||||
|
|
@ -252,9 +251,11 @@ int main(int argc, char *argv[])
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
close(res);
|
close(res);
|
||||||
unlink(temp);
|
socket_path = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unlink(socket_path);
|
||||||
|
|
||||||
listen_fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
|
listen_fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
|
||||||
if (listen_fd < 0) {
|
if (listen_fd < 0) {
|
||||||
fprintf(stderr, "can't make unix socket: %m\n");
|
fprintf(stderr, "can't make unix socket: %m\n");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue