소스 검색

Correct Child so that stderr and stdout from the child are

sent to the same output.

Deprecate ChildStream instead of correcting ChildStream.


git-svn-id: https://svn.microneil.com/svn/CodeDweller/branches/adeniz_1@98 d34b734f-a00e-4b39-a726-e4eeb87269ab
adeniz_1
adeniz 9 년 전
부모
커밋
4af1aca886
1개의 변경된 파일10개의 추가작업 그리고 2개의 파일을 삭제
  1. 10
    2
      child.cpp

+ 10
- 2
child.cpp 파일 보기

@@ -1140,8 +1140,7 @@ namespace CodeDweller {
getErrorText());
}
// Provide the stream buffers with the handles for communicating
// with the child process.
// Save the handles for communicating with the child process.
inputHandle = childStdOutAtParent;
outputHandle = childStdInAtParent;
@@ -1210,6 +1209,15 @@ namespace CodeDweller {
exit(-1);
}
if (dup2(childStdOutPipe[1], STDERR_FILENO) == -1) {
std::string errMsg;
// Send message to parent.
errMsg = "Error redirecting stderr in the child: " + getErrorText();
::write(childStdOutPipe[1], errMsg.data(), errMsg.size());
exit(-1);
}
// Close pipes.
if ( (::close(childStdInPipe[0]) != 0) ||
(::close(childStdInPipe[1]) != 0) ||

Loading…
취소
저장