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 <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/statvfs.h>
|
#include <sys/statvfs.h>
|
||||||
|
#if __linux__ || __APPLE__
|
||||||
|
extern "C" int rep_closefrom(int lower);
|
||||||
|
#define closefrom rep_closefrom
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#ifndef WIN32_LEAN_AND_MEAN
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
#define WIN32_LEAN_AND_MEAN 1
|
#define WIN32_LEAN_AND_MEAN 1
|
||||||
|
|
|
@ -3,8 +3,4 @@ set(BLENDER_SOURCES
|
||||||
SDNARead.cpp
|
SDNARead.cpp
|
||||||
HMDL.cpp)
|
HMDL.cpp)
|
||||||
|
|
||||||
if(UNIX)
|
|
||||||
list(APPEND BLENDER_SOURCES closefrom.c)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
hecl_add_list(Blender BLENDER_SOURCES)
|
hecl_add_list(Blender BLENDER_SOURCES)
|
||||||
|
|
|
@ -20,12 +20,6 @@
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#else
|
|
||||||
#include <unistd.h>
|
|
||||||
#if __linux__ || __APPLE__
|
|
||||||
extern "C" int rep_closefrom(int lower);
|
|
||||||
#define closefrom rep_closefrom
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef min
|
#undef min
|
||||||
|
|
|
@ -75,6 +75,10 @@ set(COMMON_SOURCES
|
||||||
atdna_Frontend.cpp
|
atdna_Frontend.cpp
|
||||||
atdna_CVar.cpp)
|
atdna_CVar.cpp)
|
||||||
|
|
||||||
|
if(UNIX)
|
||||||
|
list(APPEND PLAT_SRCS closefrom.c)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_library(hecl-full
|
add_library(hecl-full
|
||||||
${BACKEND_SOURCES}
|
${BACKEND_SOURCES}
|
||||||
${FRONTEND_SOURCES}
|
${FRONTEND_SOURCES}
|
||||||
|
|
|
@ -853,6 +853,7 @@ int RunProcess(const SystemChar* path, const SystemChar* const args[]) {
|
||||||
#else
|
#else
|
||||||
pid_t pid = fork();
|
pid_t pid = fork();
|
||||||
if (!pid) {
|
if (!pid) {
|
||||||
|
closefrom(3);
|
||||||
execvp(path, (char* const*)args);
|
execvp(path, (char* const*)args);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue