diff options
author | dchagin <dchagin@FreeBSD.org> | 2016-03-26 19:16:53 +0000 |
---|---|---|
committer | dchagin <dchagin@FreeBSD.org> | 2016-03-26 19:16:53 +0000 |
commit | 17c3dd308d1aad99eac700aa65049a902ace29fc (patch) | |
tree | 073c1abccfdac2c8dac8aa1519950e28f9293564 /sys/compat/linux/linux_event.c | |
parent | 8c4d28bb9d714384a2c24fcd4d09e5987bed560a (diff) | |
download | FreeBSD-src-17c3dd308d1aad99eac700aa65049a902ace29fc.zip FreeBSD-src-17c3dd308d1aad99eac700aa65049a902ace29fc.tar.gz |
When write(2) on eventfd object fails with the error EAGAIN do not return
the number of bytes written.
MFC after: 1 week
Diffstat (limited to 'sys/compat/linux/linux_event.c')
-rw-r--r-- | sys/compat/linux/linux_event.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c index f35f317..3e5a15c 100644 --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -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, |