unix: set errno in sendfile emulation
The sendfile emulation in src/unix/fs.c polls the file descriptor for write readiness. If POLLERR or POLLHUP is set, it bails out but doesn't set errno (hence it doesn't report a useful error code). Rectify that. Fixes #620.
This commit is contained in:
parent
b04fc33ef7
commit
39c8a90a91
@ -374,6 +374,7 @@ static ssize_t uv__fs_sendfile_emul(uv_fs_t* req) {
|
||||
while (n == -1 && errno == EINTR);
|
||||
|
||||
if (n == -1 || (pfd.revents & ~POLLOUT) != 0) {
|
||||
errno = EIO;
|
||||
nsent = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user