ソースを参照

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) ||

読み込み中…
キャンセル
保存