diff options
author | Jiyoung Yun <jy910.yun@samsung.com> | 2017-06-13 18:47:36 +0900 |
---|---|---|
committer | Jiyoung Yun <jy910.yun@samsung.com> | 2017-06-13 18:47:36 +0900 |
commit | 61d6a817e39d3bae0f47dbc09838d51db22a5d30 (patch) | |
tree | cb37caa1784bc738b976273335d6ed04a7cc80b0 /src/pal/src/synchmgr/synchmanager.cpp | |
parent | 5b975f8233e8c8d17b215372f89ca713b45d6a0b (diff) | |
download | coreclr-61d6a817e39d3bae0f47dbc09838d51db22a5d30.tar.gz coreclr-61d6a817e39d3bae0f47dbc09838d51db22a5d30.tar.bz2 coreclr-61d6a817e39d3bae0f47dbc09838d51db22a5d30.zip |
Imported Upstream version 2.0.0.11992upstream/2.0.0.11992
Diffstat (limited to 'src/pal/src/synchmgr/synchmanager.cpp')
-rw-r--r-- | src/pal/src/synchmgr/synchmanager.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/pal/src/synchmgr/synchmanager.cpp b/src/pal/src/synchmgr/synchmanager.cpp index d836a177bb..73b5644dbd 100644 --- a/src/pal/src/synchmgr/synchmanager.cpp +++ b/src/pal/src/synchmgr/synchmanager.cpp @@ -3525,12 +3525,22 @@ namespace CorUnix } #else // !CORECLR int rgiPipe[] = { -1, -1 }; - if (pipe(rgiPipe) == -1) + int pipeRv = +#if HAVE_PIPE2 + pipe2(rgiPipe, O_CLOEXEC); +#else + pipe(rgiPipe); +#endif // HAVE_PIPE2 + if (pipeRv == -1) { ERROR("Unable to create the process pipe\n"); fRet = false; goto CPP_exit; } +#if !HAVE_PIPE2 + fcntl(rgiPipe[0], F_SETFD, FD_CLOEXEC); // make pipe non-inheritable, if possible + fcntl(rgiPipe[1], F_SETFD, FD_CLOEXEC); +#endif // !HAVE_PIPE2 #endif // !CORECLR #if HAVE_KQUEUE && !HAVE_BROKEN_FIFO_KEVENT |