From 281afc595f4dd0a82e7f57bfbda2aeadfb869bea Mon Sep 17 00:00:00 2001 From: Dmitry Chagin Date: Mon, 27 Feb 2017 16:55:09 +0000 Subject: [PATCH] Return EINVAL when an invalid file descriptor specified. MFC after: 1 month --- sys/compat/linux/linux_event.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c index 2ce489ad1574..b7b74aa6375d 100644 --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -729,7 +729,7 @@ eventfd_close(struct file *fp, struct thread *td) efd = fp->f_data; if (fp->f_type != DTYPE_LINUXEFD || efd == NULL) - return (EBADF); + return (EINVAL); seldrain(&efd->efd_sel); knlist_destroy(&efd->efd_sel.si_note); @@ -751,7 +751,7 @@ eventfd_read(struct file *fp, struct uio *uio, struct ucred *active_cred, efd = fp->f_data; if (fp->f_type != DTYPE_LINUXEFD || efd == NULL) - return (EBADF); + return (EINVAL); if (uio->uio_resid < sizeof(eventfd_t)) return (EINVAL); @@ -797,7 +797,7 @@ eventfd_write(struct file *fp, struct uio *uio, struct ucred *active_cred, efd = fp->f_data; if (fp->f_type != DTYPE_LINUXEFD || efd == NULL) - return (EBADF); + return (EINVAL); if (uio->uio_resid < sizeof(eventfd_t)) return (EINVAL);