[Rpm-maint] [rpm-software-management/rpm] Use close_range() to set close-on-exec on all fds (PR #4149)

Alberto Ruiz notifications at github.com
Tue Mar 17 15:12:09 UTC 2026


@aruiz commented on this pull request.



> @@ -1803,6 +1803,11 @@ void rpmSetCloseOnExec(void)
     const int min_fd = STDERR_FILENO; /* don't touch stdin/out/err */
     int fd;
 
+#ifdef HAVE_CLOSE_RANGE
+    if (close_range(min_fd + 1, ~0U, CLOSE_RANGE_CLOEXEC) == 0)
+        return;

That's a good point.....

Question, would it be better to just do #else / #endif and do one or the other or do you want me to keep it this way?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/4149#discussion_r2947528136
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/4149/review/3961598274 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20260317/731c66d2/attachment.htm>


More information about the Rpm-maint mailing list