Skip site navigation (1)Skip section navigation (2)


| raw e-mail | index | archive | help
The branch stable/14 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=3bd1780213bf53f6229ea2f00b1b975b18652836

commit 3bd1780213bf53f6229ea2f00b1b975b18652836
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-09-07 10:59:45 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-10-13 00:23:43 +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 50d04e1fe253..d1145c37e128 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -1771,7 +1771,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 3221885c9277..ef8c397a05b6 100644
--- a/sys/kern/sys_procdesc.c
+++ b/sys/kern/sys_procdesc.c
@@ -132,7 +132,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;
@@ -178,7 +178,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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?>