Commit ad17d96c authored by Mart Lubbers's avatar Mart Lubbers

Merge branch '20-callprocess-blocks-until-called-process-terminates' into 'master'

use correct flag (FD_CLOEXEC instead of O_CLOEXEC) for 'fcntl'

Closes #20

See merge request !66
parents f0ce5316 e4ed817d
Pipeline #8113 passed with stage
in 1 minute and 51 seconds
......@@ -26,8 +26,8 @@ STDERR_FILENO :== 2
FIONREAD :== 0x541B
F_SETFD :== 2
O_CLOEXEC :== 02000000
F_SETFD :== 2
FD_CLOEXEC :== 1
//Posix API calls
errno :: !*w -> (!Int,!*w)
......
......@@ -25,8 +25,8 @@ STDERR_FILENO :== 2
FIONREAD :== 0x4004667F
F_SETFD :== 2
O_CLOEXEC :== 02000000
F_SETFD :== 2
FD_CLOEXEC :== 1
//Posix API calls
errno :: !*w -> (!Int,!*w)
......
......@@ -109,8 +109,8 @@ runProcessChildProcessExec :: !FilePath ![String] !(Maybe String) !Int !Int !*Wo
runProcessChildProcessExec path args mCurrentDirectory pipeExecErrorOut pipeExecErrorIn world
# (res, world) = close pipeExecErrorOut world
| res == -1 = passLastOSErrorToParent pipeExecErrorIn world
// set O_CLOEXEC such that parent is informed if 'execvp' succeeds
# (res, world) = fcntlArg pipeExecErrorIn F_SETFD O_CLOEXEC world
// set FD_CLOEXEC such that parent is informed if 'execvp' succeeds
# (res, world) = fcntlArg pipeExecErrorIn F_SETFD FD_CLOEXEC world
| res == -1 = passLastOSErrorToParent pipeExecErrorIn world
//Chdir
# (res,world) = case mCurrentDirectory of
......
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