diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 9ae44b909d8..a2b45edf7bd 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -2101,6 +2101,8 @@ linux_sendfile_common(struct thread *td, l_int out, l_int in, td->td_retval[0] = (ssize_t)bytes_read; drop: fdrop(fp, td); + if (error == ENOTSOCK) + error = EINVAL; return (error); }