diff options
| author | neumann <neumann> | 2023-06-30 09:12:02 (GMT) |
|---|---|---|
| committer | neumann <neumann> | 2023-06-30 09:12:02 (GMT) |
| commit | 3f68e9f64ffb09416fc76db2a30bb132f04e4569 (patch) | |
| tree | eb61ad7978710de208b2cb56cded674c9e2fe3db | |
| parent | 414a984d0417c098b2b9b29d3b5a4aea8eaca5d0 (diff) | |
| download | tcl-3f68e9f64ffb09416fc76db2a30bb132f04e4569.zip tcl-3f68e9f64ffb09416fc76db2a30bb132f04e4569.tar.gz tcl-3f68e9f64ffb09416fc76db2a30bb132f04e4569.tar.bz2 | |
Added auto-configuration of posix_spawnp()
Removed the manual setting of USE_POSIX_SPAWN and
replaced it by HAVE_POSIX_SPAWNP.
| -rw-r--r-- | unix/tcl.m4 | 2 | ||||
| -rw-r--r-- | unix/tclUnixPipe.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 0ef9f3d..f07d55b 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -2105,6 +2105,7 @@ dnl # preprocessing tests use only CPPFLAGS. AC_SUBST(DLL_INSTALL_DIR) AC_SUBST(INSTALL_STUB_LIB) AC_SUBST(RANLIB) + AC_CHECK_FUNCS([posix_spawnp]) ]) #-------------------------------------------------------------------- @@ -3085,6 +3086,7 @@ if test "x$NEED_FAKE_RFC2553" = "x1"; then AC_CHECK_FUNC(strlcpy) fi ]) + # Local Variables: # mode: autoconf # End: diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c index f481f66..48a0e6a 100644 --- a/unix/tclUnixPipe.c +++ b/unix/tclUnixPipe.c @@ -13,9 +13,7 @@ #include "tclInt.h" -#define USE_POSIX_SPAWN 1 - -#ifdef USE_POSIX_SPAWN +#ifdef HAVE_POSIX_SPAWNP # include <spawn.h> #endif @@ -445,7 +443,7 @@ TclpCreateProcess( newArgv[i] = Tcl_UtfToExternalDString(NULL, argv[i], -1, &dsArray[i]); } -#if defined(USE_VFORK) || defined(USE_POSIX_SPAWN) +#if defined(USE_VFORK) || defined(HAVE_POSIX_SPAWNP) /* * After vfork(), do not call code in the child that changes global state, * because it is using the parent's memory space at that point and writes @@ -465,7 +463,7 @@ TclpCreateProcess( } #endif -#ifdef USE_POSIX_SPAWN +#ifdef HAVE_POSIX_SPAWNP { posix_spawn_file_actions_t actions; posix_spawnattr_t attr; @@ -553,7 +551,7 @@ TclpCreateProcess( TclStackFree(interp, dsArray); if (pid == -1) { -#ifdef USE_POSIX_SPAWN +#ifdef HAVE_POSIX_SPAWNP Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't execute \"%s\": %s", argv[0], Tcl_PosixError(interp))); #else |
