When write(2) on eventfd object fails with the error EAGAIN do not return

the number of bytes written.

MFC after:	1 week
This commit is contained in:
dchagin 2016-03-26 19:16:53 +00:00
parent 8c4d28bb9d
commit 17c3dd308d

View File

@ -751,6 +751,8 @@ retry:
if (UINT64_MAX - efd->efd_count <= count) {
if ((efd->efd_flags & LINUX_O_NONBLOCK) != 0) {
mtx_unlock(&efd->efd_lock);
/* Do not not return the number of bytes written */
uio->uio_resid += sizeof(eventfd_t);
return (EAGAIN);
}
error = mtx_sleep(&efd->efd_count, &efd->efd_lock,