The branch stable/15 has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=69d29fedc1bd7f98796a00a8338d1c9555f4dc1e

commit 69d29fedc1bd7f98796a00a8338d1c9555f4dc1e
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2026-05-20 02:03:32 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2026-08-16 02:41:20 +0000

    sys_procdesc: extract pdtofdflags()
    
    (cherry picked from commit 974770199877ae7aa912b6dced909429c52dea93)
---
 sys/kern/sys_procdesc.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/sys/kern/sys_procdesc.c b/sys/kern/sys_procdesc.c
index edf98b7f69d9..cb2d779df158 100644
--- a/sys/kern/sys_procdesc.c
+++ b/sys/kern/sys_procdesc.c
@@ -241,6 +241,17 @@ procdesc_new(struct proc *p, int flags)
        p->p_procdesc = pd;
 }
 
+static int
+pdtofdflags(int flags)
+{
+       int fflags;
+
+       fflags = 0;
+       if (flags & PD_CLOEXEC)
+               fflags |= O_CLOEXEC;
+       return (fflags);
+}
+
 /*
  * Create a new process decriptor for the process that refers to it.
  */
@@ -248,13 +259,7 @@ int
 procdesc_falloc(struct thread *td, struct file **resultfp, int *resultfd,
     int flags, struct filecaps *fcaps)
 {
-       int fflags;
-
-       fflags = 0;
-       if (flags & PD_CLOEXEC)
-               fflags = O_CLOEXEC;
-
-       return (falloc_caps(td, resultfp, resultfd, fflags, fcaps));
+       return (falloc_caps(td, resultfp, resultfd, pdtofdflags(flags), fcaps));
 }
 
 /*

Reply via email to