summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-05-15 16:18:01 +0200
committerwm4 <wm4@nowhere>2020-05-15 16:37:41 +0200
commit810b37fc3f538b33d73546c76e9b4c86e7b906a5 (patch)
tree62fc207991915d4c8768f0029df1d3d2838eeaa1
parent1c66e03ae5e995b567cb252a853927f0de1dbba5 (diff)
downloadmpv-810b37fc3f538b33d73546c76e9b4c86e7b906a5.tar.bz2
mpv-810b37fc3f538b33d73546c76e9b4c86e7b906a5.tar.xz
ipc: mark client sockets as CLOEXEC
I suppose it would have left the socket open if the client closed its FD.
-rw-r--r--input/ipc-unix.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/input/ipc-unix.c b/input/ipc-unix.c
index abef0972d9..cd788e0061 100644
--- a/input/ipc-unix.c
+++ b/input/ipc-unix.c
@@ -272,6 +272,8 @@ bool mp_ipc_start_anon_client(struct mp_ipc_ctx *ctx, struct mpv_handle *h,
int pair[2];
if (socketpair(AF_UNIX, SOCK_STREAM, 0, pair))
return false;
+ mp_set_cloexec(pair[0]);
+ mp_set_cloexec(pair[1]);
struct client_arg *client = talloc_ptrtype(NULL, client);
*client = (struct client_arg){