Commit bc7ba7af authored by Dmitry Shulga's avatar Dmitry Shulga

MDEV-27758: Errors when building Connect engine on os x 11.6.2

Added checking for support of vfork by a platform where
building being done. Set HAVE_VFORK macros in case vfork()
system call is supported. Use vfork() system call if the
macros HAVE_VFORK is set, else use fork().
parent 3c209bfc
......@@ -577,3 +577,5 @@
#endif // !defined(__STDC_FORMAT_MACROS)
#endif
#cmakedefine HAVE_VFORK 1
......@@ -1033,3 +1033,19 @@ IF(NOT MSVC)
HAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE
)
ENDIF()
MY_CHECK_C_COMPILER_FLAG("-Werror")
IF(have_C__Werror)
SET(SAVE_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror")
CHECK_C_SOURCE_COMPILES("
#include <unistd.h>
int main()
{
pid_t pid=vfork();
return (int)pid;
}"
HAVE_VFORK
)
SET(CMAKE_REQUIRED_FLAGS ${SAVE_CMAKE_REQUIRED_FLAGS})
ENDIF()
......@@ -112,7 +112,11 @@ int Xcurl(PGLOBAL g, PCSZ Http, PCSZ Uri, PCSZ filename)
} // endif f
#ifdef HAVE_VFORK
pID = vfork();
#else
pID = fork();
#endif
sprintf(fn, "-o%s", filename);
if (pID == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment