aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Niklas Haas <git@haasn.xyz>2018-10-31 05:34:21 +0100
committerGravatar sfan5 <sfan5@live.de>2018-10-31 09:20:44 +0100
commit880c59d1890286899a49be8c743f23889c42e137 (patch)
treeb4ba9c58f1e8805413af78c834bff66701c44c96
parent6f0ed8e0b2605475850d85608bfa4bbe1bb38a0b (diff)
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`.
-rw-r--r--input/ipc-unix.c2
1 files changed, 1 insertions, 1 deletions
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;
}