|
|
@@ -848,6 +848,7 @@ namespace CodeDweller { |
|
|
|
|
|
|
|
childStarted = false;
|
|
|
|
childExited = false;
|
|
|
|
childExitedInferred = false;
|
|
|
|
exitCodeObtainedFlag = false;
|
|
|
|
exitCode = 0;
|
|
|
|
|
|
|
@@ -1021,7 +1022,7 @@ namespace CodeDweller { |
|
|
|
}
|
|
|
|
|
|
|
|
bool Child::isRunning() const {
|
|
|
|
return childStarted && !childExited;
|
|
|
|
return childStarted && !childExited && !childExitedInferred;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Child::errorOccurred(std::string &errorDescription) const {
|
|
|
@@ -1137,7 +1138,7 @@ namespace CodeDweller { |
|
|
|
&startInfo, // STARTUPINFO pointer
|
|
|
|
&processInfo); // receives PROCESS_INFORMATION
|
|
|
|
|
|
|
|
// If an error occurs, exit the application.
|
|
|
|
// If an error occurs, throw.
|
|
|
|
if (!status ) {
|
|
|
|
throw std::runtime_error("Error from CreateProcess with "
|
|
|
|
"command line \"" + cmdline + "\": " +
|
|
|
@@ -1484,6 +1485,7 @@ namespace CodeDweller { |
|
|
|
nBytesRead = ::read(inputFileDescriptor,
|
|
|
|
bufferPtr,
|
|
|
|
bufferCapacity);
|
|
|
|
|
|
|
|
if (-1 == nBytesRead) {
|
|
|
|
|
|
|
|
if (stopReaderFlag) {
|
|
|
@@ -1497,6 +1499,8 @@ namespace CodeDweller { |
|
|
|
} else if (0 == nBytesRead) {
|
|
|
|
|
|
|
|
// EOF; child exited.
|
|
|
|
childExitedInferred = true;
|
|
|
|
stopWriterFlag = true;
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
@@ -1539,6 +1543,14 @@ namespace CodeDweller { |
|
|
|
|
|
|
|
void Child::writeToChild() {
|
|
|
|
|
|
|
|
#ifndef _WIN32
|
|
|
|
|
|
|
|
// Writing to a broken pipe raises SIGPIPE. Ignore that signal;
|
|
|
|
// the error is handled by the return value of ::write.
|
|
|
|
signal(SIGPIPE, SIG_IGN);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
std::vector<char> localWriteBuffer(bufferCapacity);
|
|
|
|
size_t nLocalWriteBytes;
|
|
|
|
|