It wasn't fixed, it was using kqueue so avoided!
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-#include <stdio.h>
+
#if (defined(__unix__) || defined(unix)) && !defined(USG)
#include <sys/param.h>
#endif
if (ctx->ps_control_pid != getpid()) {
/* Prohibit new files, sockets, etc */
-#if defined(__linux__) || defined(__sun) || defined(__OpenBSD__)
+#if (defined(__linux__) || defined(__sun) || defined(__OpenBSD__)) && \
+ !defined(HAVE_KQUEUE)
/*
* If poll(2) is called with nfds > RLIMIT_NOFILE
* then it returns EINVAL.
*/
unsigned long maxfd;
maxfd = (unsigned long)eloop_event_count(ctx->eloop);
+ if (IN_PRIVSEP_SE(ctx))
+ maxfd++; /* why? */
struct rlimit rmaxfd = {
.rlim_cur = maxfd,