1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 09:02:38 +00:00

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`.
This commit is contained in:
Niklas Haas 2018-10-31 05:34:21 +01:00 committed by sfan5
parent 6f0ed8e0b2
commit 880c59d189

View File

@ -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;
}