Sfoglia il codice sorgente

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 anni fa
parent
commit
4af1aca886
1 ha cambiato i file con 10 aggiunte e 2 eliminazioni
  1. 10
    2
      child.cpp

+ 10
- 2
child.cpp Vedi File

@@ -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…
Annulla
Salva