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
1 changed files with 1 additions and 1 deletions

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