utils: Directly use syscall() to close open FDs in closefrom()

This avoids any allocations, since calling malloc() after fork() is
potentially unsafe.

Fixes #990.
This commit is contained in:
Tobias Brunner
2015-08-17 11:19:44 +02:00
parent b410d7f8ff
commit f25f4192c7
2 changed files with 55 additions and 7 deletions
+1 -1
View File
@@ -591,7 +591,7 @@ AC_CHECK_FUNC([syslog], [
])
AM_CONDITIONAL(USE_SYSLOG, [test "x$syslog" = xtrue])
AC_CHECK_HEADERS(sys/sockio.h glob.h net/if_tun.h)
AC_CHECK_HEADERS(sys/sockio.h sys/syscall.h glob.h net/if_tun.h)
AC_CHECK_HEADERS(net/pfkeyv2.h netipsec/ipsec.h netinet6/ipsec.h linux/udp.h)
AC_CHECK_HEADERS([netinet/ip6.h linux/fib_rules.h], [], [],
[