mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-22 21:37:38 -04:00
treewide: make more file descriptors cloexec
Avoid file descriptor leakage into child processes by marking them `O_CLOEXEC`.
This commit is contained in:
parent
8344117e7b
commit
ccfb61efa4
9 changed files with 11 additions and 11 deletions
|
|
@ -263,7 +263,7 @@ int main(int argc, char *argv[])
|
|||
spa_assert_se(loop != NULL);
|
||||
context = pw_context_new(pw_main_loop_get_loop(loop), NULL, 0);
|
||||
|
||||
if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) {
|
||||
if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, fds) < 0) {
|
||||
spa_assert_not_reached();
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -286,7 +286,7 @@ int main(int argc, char *argv[])
|
|||
int fds2[2];
|
||||
struct pw_protocol_native_connection *in2, *out2;
|
||||
|
||||
if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds2) < 0)
|
||||
if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, fds2) < 0)
|
||||
spa_assert_not_reached();
|
||||
|
||||
in2 = pw_protocol_native_connection_new(context, fds2[0]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue