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,
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to