mirror of https://github.com/AxioDL/metaforce.git
Add closefrom call to RunProcess
This commit is contained in:
parent
6626557cc4
commit
1f04f7ae12
|
@ -9,6 +9,10 @@
|
|||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/statvfs.h>
|
||||
#if __linux__ || __APPLE__
|
||||
extern "C" int rep_closefrom(int lower);
|
||||
#define closefrom rep_closefrom
|
||||
#endif
|
||||
#else
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
|
|
|
@ -3,8 +3,4 @@ set(BLENDER_SOURCES
|
|||
SDNARead.cpp
|
||||
HMDL.cpp)
|
||||
|
||||
if(UNIX)
|
||||
list(APPEND BLENDER_SOURCES closefrom.c)
|
||||
endif()
|
||||
|
||||
hecl_add_list(Blender BLENDER_SOURCES)
|
||||
|
|
|
@ -20,12 +20,6 @@
|
|||
#if _WIN32
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#if __linux__ || __APPLE__
|
||||
extern "C" int rep_closefrom(int lower);
|
||||
#define closefrom rep_closefrom
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#undef min
|
||||
|
|
|
@ -75,6 +75,10 @@ set(COMMON_SOURCES
|
|||
atdna_Frontend.cpp
|
||||
atdna_CVar.cpp)
|
||||
|
||||
if(UNIX)
|
||||
list(APPEND PLAT_SRCS closefrom.c)
|
||||
endif()
|
||||
|
||||
add_library(hecl-full
|
||||
${BACKEND_SOURCES}
|
||||
${FRONTEND_SOURCES}
|
||||
|
|
|
@ -853,6 +853,7 @@ int RunProcess(const SystemChar* path, const SystemChar* const args[]) {
|
|||
#else
|
||||
pid_t pid = fork();
|
||||
if (!pid) {
|
||||
closefrom(3);
|
||||
execvp(path, (char* const*)args);
|
||||
exit(1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue