svn commit: r297503 - stable/10/sys/compat/linux

Dmitry Chagin dchagin at FreeBSD.org
Sat Apr 2 06:18:20 UTC 2016


Author: dchagin
Date: Sat Apr  2 06:18:19 2016
New Revision: 297503
URL: https://svnweb.freebsd.org/changeset/base/297503

Log:
  MFC r297297:
  
  When write(2) on eventfd object fails with the error EAGAIN do not return the number of bytes written.

Modified:
  stable/10/sys/compat/linux/linux_event.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/compat/linux/linux_event.c
==============================================================================
--- stable/10/sys/compat/linux/linux_event.c	Sat Apr  2 06:15:14 2016	(r297502)
+++ stable/10/sys/compat/linux/linux_event.c	Sat Apr  2 06:18:19 2016	(r297503)
@@ -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,


More information about the svn-src-all mailing list