mirror of https://github.com/mpv-player/mpv
ipc: fix confusion of write() return value and errno
Found by Coverity.
This commit is contained in:
parent
3938349cd5
commit
4704fab82c
|
@ -475,12 +475,12 @@ static int ipc_write(int fd, const char *buf, size_t count)
|
||||||
ssize_t rc = write(fd, buf, count);
|
ssize_t rc = write(fd, buf, count);
|
||||||
if (rc <= 0) {
|
if (rc <= 0) {
|
||||||
if (rc == 0)
|
if (rc == 0)
|
||||||
return ECONNRESET;
|
return -1;
|
||||||
|
|
||||||
if (rc == EINTR)
|
if (errno == EINTR)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (rc == EAGAIN)
|
if (errno == EAGAIN)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
|
Loading…
Reference in New Issue