File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,12 @@ if(CMAKE_USE_PTHREADS_INIT)
6161 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread" )
6262endif ()
6363
64+ include (CheckFunctionExists)
65+ check_function_exists(closefrom HAVE_CLOSEFROM)
66+ if (HAVE_CLOSEFROM)
67+ add_definitions (-DHAVE_CLOSEFROM)
68+ endif ()
69+
6470add_definitions (-DASIO_STANDALONE)
6571if (NOT EXISTS "${CMAKE_SOURCE_DIR} /src/submodules/asio/.git" )
6672 execute_process (COMMAND git submodule update --init -- src/submodules/asio
Original file line number Diff line number Diff line change 2424#include < thread>
2525#include < exception>
2626#include < memory>
27+ #include < unistd.h>
2728
2829int main (int argc, char * argv[])
2930{
31+ #ifdef HAVE_CLOSEFROM
32+ // close any inherrited file descriptors
33+ closefrom (3 );
34+ #endif
3035try
3136{
3237 CmdArgs Args (argc,argv);
You can’t perform that action at this time.
0 commit comments