Skip to contentSkip to conversation

ucm: use close_range on _GNU_SOURCE

PATCH New Jochen Sprickerhof 1 participant 1 message Aug 4, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ucm: use close_range on _GNU_SOURCE

---
 src/ucm/ucm_exec.c | 4 ++++
 1 file changed, 4 insertions(+)
src/ucm/ucm_exec.c +4 -0
index 276cf592..b79a84ae 100644
@@ -254,8 +254,12 @@ int uc_mgr_exec(const char *prog)
 
 		close(f);
 
+#if defined(_GNU_SOURCE)
+		close_range(3, maxfd, 0);
+#else
 		for (f = 3; f < maxfd; f++)
 			close(f);
+#endif
 
 		/* install default handlers for the forked process */
 		signal(SIGINT, SIG_DFL);
Signature · 1 line
2.50.0