From 880c59d1890286899a49be8c743f23889c42e137 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Wed, 31 Oct 2018 05:34:21 +0100 Subject: ipc-unix: don't blow up on readonly fd:// On my system, when trying to use mpv with a read-only fd created by python 3.7, `send` triggers ENOTSOCK, not EBADF. Extend the logic to detect non-writable fds by this `errno`. --- input/ipc-unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input/ipc-unix.c b/input/ipc-unix.c index ff8327b178..a9cb66e2c6 100644 --- a/input/ipc-unix.c +++ b/input/ipc-unix.c @@ -73,7 +73,7 @@ static int ipc_write_str(struct client_arg *client, const char *buf) if (rc == 0) return -1; - if (errno == EBADF) { + if (errno == EBADF || errno == ENOTSOCK) { client->writable = false; return 0; } -- cgit v1.2.3