diff options
author | wm4 <wm4@nowhere> | 2014-11-21 05:10:50 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-11-21 05:18:05 +0100 |
commit | 4704fab82c084dbcca52b5e75f7a36877921dbd9 (patch) | |
tree | ce9446e34c21efbf7e00931874c24f6c537f264c /input/ipc.c | |
parent | 3938349cd582abc6a5b39f2807bab5f428a0815b (diff) | |
download | mpv-4704fab82c084dbcca52b5e75f7a36877921dbd9.tar.bz2 mpv-4704fab82c084dbcca52b5e75f7a36877921dbd9.tar.xz |
ipc: fix confusion of write() return value and errno
Found by Coverity.
Diffstat (limited to 'input/ipc.c')
-rw-r--r-- | input/ipc.c | 6 |
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; |