summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordchagin <dchagin@FreeBSD.org>2016-04-02 06:18:19 +0000
committerdchagin <dchagin@FreeBSD.org>2016-04-02 06:18:19 +0000
commitbb89744b6e6dd53145b3b109086ae0ff2acbb71f (patch)
treed7b59c82b1409f3d7bb08d801776cb836f007069
parent63a98b35e794424aa8319138b025955acf776027 (diff)
downloadFreeBSD-src-bb89744b6e6dd53145b3b109086ae0ff2acbb71f.zip
FreeBSD-src-bb89744b6e6dd53145b3b109086ae0ff2acbb71f.tar.gz
MFC r297297:
When write(2) on eventfd object fails with the error EAGAIN do not return the number of bytes written.
-rw-r--r--sys/compat/linux/linux_event.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c
index a089d43..8d704aa 100644
--- a/sys/compat/linux/linux_event.c
+++ b/sys/compat/linux/linux_event.c
@@ -748,6 +748,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,
OpenPOWER on IntegriCloud