git: ac3444a9528e - stable/15 - kern: replace several EBADF with EINVAL
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 11 Oct 2025 05:08:31 UTC
The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ac3444a9528eca7beb8a6856e225951a2db46cbf commit ac3444a9528eca7beb8a6856e225951a2db46cbf Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2025-09-07 10:59:45 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2025-10-11 05:08:13 +0000 kern: replace several EBADF with EINVAL (cherry picked from commit fd9e09cb2ab07993e8dc783c802f273329e70bb8) --- sys/kern/kern_event.c | 2 +- sys/kern/sys_procdesc.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 72cbff6c1371..23d8dc9cf54a 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -1864,7 +1864,7 @@ kqueue_acquire(struct file *fp, struct kqueue **kqp) kq = fp->f_data; if (fp->f_type != DTYPE_KQUEUE || kq == NULL) - return (EBADF); + return (EINVAL); *kqp = kq; KQ_LOCK(kq); if ((kq->kq_state & KQ_CLOSING) == KQ_CLOSING) { diff --git a/sys/kern/sys_procdesc.c b/sys/kern/sys_procdesc.c index 11bd1b6f30e1..54b03fc82c90 100644 --- a/sys/kern/sys_procdesc.c +++ b/sys/kern/sys_procdesc.c @@ -129,7 +129,7 @@ procdesc_find(struct thread *td, int fd, const cap_rights_t *rightsp, if (error) return (error); if (fp->f_type != DTYPE_PROCDESC) { - error = EBADF; + error = EINVAL; goto out; } pd = fp->f_data; @@ -175,7 +175,7 @@ kern_pdgetpid(struct thread *td, int fd, const cap_rights_t *rightsp, if (error) return (error); if (fp->f_type != DTYPE_PROCDESC) { - error = EBADF; + error = EINVAL; goto out; } *pidp = procdesc_pid(fp);