File tree Expand file tree Collapse file tree 4 files changed +20
-11
lines changed
Expand file tree Collapse file tree 4 files changed +20
-11
lines changed Original file line number Diff line number Diff line change 1+ #ifndef BSD_CLOSEFROM_H_
2+ #define BSD_CLOSEFROM_H_
3+
4+ void closefrom (int lowfd );
5+
6+ #endif // BSD_CLOSEFROM_H_
Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ struct std_handle {
2323};
2424
2525void closefrom_excluding (int from , int excluding );
26- void closefrom (int lowfd );
2726
2827// defined in find_executable.c
2928#if !defined(HAVE_EXECVPE )
Original file line number Diff line number Diff line change 77#include "runProcess.h"
88#include "common.h"
99
10+ #include "bsd_closefrom.h"
11+
1012#include <unistd.h>
1113#include <errno.h>
1214#include <sys/wait.h>
1921#include <signal.h>
2022#endif
2123
22- #if defined(HAVE_CLOSE_RANGE )
24+ #if defined(HAVE_LINUX_CLOSE_RANGE_H )
25+ #define _GNU_SOURCE
2326#include <linux/close_range.h>
2427#endif
2528
Original file line number Diff line number Diff line change @@ -17,15 +17,16 @@ AC_CHECK_FUNCS([setitimer sysconf])
1717AC_CHECK_FUNCS ( [ execvpe] )
1818
1919# check for headers and functions used by bsd_closefrom.c
20- AC_CHECK_HEADERS ( [ dirent.h fcntl.h libproc.h ndir.h sys/dir.h sys/ndir.h] )
21- AC_CHECK_FUNCS ( [
22- closefrom
23- close_range
24- dirfd
25- proc_pid
26- proc_pidinfo
27- sysconf
28- ] )
20+ AC_CHECK_HEADERS ( [ dirent.h fcntl.h libproc.h linux/close_range.h ndir.h sys/dir.h sys/ndir.h] )
21+ AC_CHECK_FUNCS ( [ closefrom close_range dirfd proc_pidinfo sysconf] )
22+ AC_MSG_CHECKING ( [ for /proc/pid/fd directory] )
23+ if test -d "/proc/$$/fd" ; then
24+ AC_DEFINE ( [ HAVE_PROC_PID] , [ 1] , [ Define if you have /proc/$pid/fd] )
25+ AC_MSG_RESULT ( [ yes] )
26+ else
27+ AC_MSG_RESULT ( [ no] )
28+ fi
29+
2930
3031# posix_spawn checks
3132AC_CHECK_HEADERS ( [ spawn.h] )
You can’t perform that action at this time.
0 commit comments