mirror of
https://git.freebsd.org/ports.git
synced 2025-06-22 05:00:30 -04:00
Don't do 1021 calls to close() when a single closefrom() will do. This patch has been submitted upstream (by the reporter) but is languishing there; there's a big difference between upstream's development branch and the released stable version. I've taken the initial patch from FreeBSD bugzilla, lightly mutated it with upstream work. PR: 240549 Reported by: rozhuk.im@gmail.com
21 lines
463 B
C
21 lines
463 B
C
--- dbus/dbus-sysdeps-unix.c.orig 2020-07-02 09:08:39 UTC
|
|
+++ dbus/dbus-sysdeps-unix.c
|
|
@@ -4469,6 +4469,10 @@ _dbus_socket_can_pass_unix_fd (DBusSocket fd)
|
|
void
|
|
_dbus_close_all (void)
|
|
{
|
|
+#ifdef __FreeBSD__
|
|
+ closefrom(3);
|
|
+#else
|
|
+#error Expected to be FreeBSD with closefrom()
|
|
int maxfds, i;
|
|
|
|
#ifdef __linux__
|
|
@@ -4525,6 +4528,7 @@ _dbus_close_all (void)
|
|
/* close all inherited fds */
|
|
for (i = 3; i < maxfds; i++)
|
|
close (i);
|
|
+#endif
|
|
}
|
|
|
|
/**
|