summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-21 05:10:50 +0100
committerwm4 <wm4@nowhere>2014-11-21 05:18:05 +0100
commit4704fab82c084dbcca52b5e75f7a36877921dbd9 (patch)
treece9446e34c21efbf7e00931874c24f6c537f264c
parent3938349cd582abc6a5b39f2807bab5f428a0815b (diff)
downloadmpv-4704fab82c084dbcca52b5e75f7a36877921dbd9.tar.bz2
mpv-4704fab82c084dbcca52b5e75f7a36877921dbd9.tar.xz
ipc: fix confusion of write() return value and errno
Found by Coverity.
-rw-r--r--input/ipc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/input/ipc.c b/input/ipc.c
index 3ce37cbb24..028ef7c7ab 100644
--- a/input/ipc.c
+++ b/input/ipc.c
@@ -475,12 +475,12 @@ static int ipc_write(int fd, const char *buf, size_t count)
ssize_t rc = write(fd, buf, count);
if (rc <= 0) {
if (rc == 0)
- return ECONNRESET;
+ return -1;
- if (rc == EINTR)
+ if (errno == EINTR)
continue;
- if (rc == EAGAIN)
+ if (errno == EAGAIN)
return 0;
return rc;