The branch main has been updated by kib:

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

commit d9cc5dd87b50348b60ca8aea1d3445c25e9c1a1c
Author:     Konstantin Belousov <k...@freebsd.org>
AuthorDate: 2025-07-08 21:53:08 +0000
Commit:     Konstantin Belousov <k...@freebsd.org>
CommitDate: 2025-07-09 03:44:28 +0000

    fcntl(F_SETFD): make FD_CLOFORK non-sticky
    
    There is no reason for it to be non-modifing by F_SETFD.
    
    Reviewed by:    markj
    Sponsored by:   The FreeBSD Foundation
    Differential revision:  https://reviews.freebsd.org/D51212
---
 sys/kern/kern_descrip.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 2e1da2fdee29..93bdd41d1515 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -632,8 +632,8 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg)
                        /*
                         * UF_RESOLVE_BENEATH is sticky and cannot be cleared.
                         */
-                       fde->fde_flags = (fde->fde_flags & ~UF_EXCLOSE) |
-                           fd_to_fde_flags(arg);
+                       fde->fde_flags = (fde->fde_flags &
+                           ~(UF_EXCLOSE | UF_FOCLOSE)) | fd_to_fde_flags(arg);
                        error = 0;
                }
                FILEDESC_XUNLOCK(fdp);

Reply via email to