Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Jul 2025 03:44:49 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: d9cc5dd87b50 - main - fcntl(F_SETFD): make FD_CLOFORK non-sticky
Message-ID:  <202507090344.5693inx0061616@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kib:

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

commit d9cc5dd87b50348b60ca8aea1d3445c25e9c1a1c
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-07-08 21:53:08 +0000
Commit:     Konstantin Belousov <kib@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);



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