Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Apr 2016 06:18:19 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r297503 - stable/10/sys/compat/linux
Message-ID:  <201604020618.u326IJwm065623@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604020618.u326IJwm065623>