git: 6ea35ec38acf - stable/15 - fget_procdesc(): change error for non-procdesc type from EBADF to EINVAL

Konstantin Belousov <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a8124a6.4432f.f9b47ca__1198.92241652764$1786848763$gmane$org@gitrepo.freebsd.org>
The branch stable/15 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=6ea35ec38acf99278fae979356b9d5700c07e9d1

commit 6ea35ec38acf99278fae979356b9d5700c07e9d1
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2026-07-16 07:50:34 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2026-08-16 02:41:32 +0000

    fget_procdesc(): change error for non-procdesc type from EBADF to EINVAL
    
    (cherry picked from commit e18844223d1eabb7e435ff9da20d88915d3f4675)
---
 sys/kern/sys_procdesc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/kern/sys_procdesc.c b/sys/kern/sys_procdesc.c
index 2a2be3f8ec69..07e431d4c381 100644
--- a/sys/kern/sys_procdesc.c
+++ b/sys/kern/sys_procdesc.c
@@ -716,7 +716,7 @@ fget_procdesc(struct thread *td, int pdfd, const cap_rights_t *cap_rights,
 		return (error);
 	*pfp = fp;
 	if (fp->f_type != DTYPE_PROCDESC)
-		return (EBADF);
+		return (EINVAL);
 	pd = fp->f_data;
 	if (pp != NULL) {
 		p = pd->pd_proc;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.