ipc: fix confusion of write() return value and errno

Found by Coverity.
This commit is contained in:
wm4 2014-11-21 05:10:50 +01:00
parent 3938349cd5
commit 4704fab82c
1 changed files with 3 additions and 3 deletions

View File

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