Преглед на файлове

Tested on Windows.


git-svn-id: https://svn.microneil.com/svn/CodeDweller/branches/adeniz_1@83 d34b734f-a00e-4b39-a726-e4eeb87269ab
adeniz_1
adeniz преди 9 години
родител
ревизия
b00945c73e
променени са 1 файла, в които са добавени 19 реда и са изтрити 20 реда
  1. 19
    20
      child.cpp

+ 19
- 20
child.cpp Целия файл

@@ -359,12 +359,9 @@ namespace CodeDweller {
bool errorOccurred = false;
#ifdef _WIN32
if (!TerminateProcess(childProcess, terminateExitCode)) {
errorString += (errorOccurred ? "\n" : "");
errorString += "Error terminating the child process: " +
getErrorText();
errorOccurred = true;
}
// Ignore errors. Reason: Terminating a proces that doesn't
// exist (e.g. has exited) gives an error.
(void) TerminateProcess(childProcess, terminateExitCode);
#else
if (kill(childPid, SIGKILL) != 0) {
errorString += (errorOccurred ? "\n" : "");
@@ -997,22 +994,19 @@ namespace CodeDweller {
bool errorOccurred = false;
#ifdef _WIN32
if (!CloseHandle(inputHandle)) {
// Ignore errors. Reason: Terminating a proces that doesn't
// exist (e.g. has exited) gives an error.
(void) TerminateProcess(childProcess, terminateExitCode);
if (CloseHandle(inputHandle) == 0) {
errorString = "Error closing input from the child: " + getErrorText();
errorOccurred = true;
}
if (!CloseHandle(outputHandle)) {
if (CloseHandle(outputHandle) == 0) {
errorString += (errorOccurred ? "\n" : "");
errorString += "Error closing output to the child: " + getErrorText();
errorOccurred = true;
}
if (!TerminateProcess(childProcess, terminateExitCode)) {
errorString += (errorOccurred ? "\n" : "");
errorString += "Error terminating the child process: " +
getErrorText();
errorOccurred = true;
}
#else
if (0 != ::close(inputFileDescriptor)) {
errorString = "Error closing input from the child: " + getErrorText();
@@ -1044,11 +1038,9 @@ namespace CodeDweller {
}
if (threadsAreRunning) {
readerThread.join();
writerThread.join();
threadsAreRunning = false;
}
// Reset.
@@ -1484,9 +1476,16 @@ namespace CodeDweller {
break;
}
errorText = "Error reading from the child process: ";
errorText += getErrorText();
break;
// Broken pipe occurs when the child exits; this is not
// necessarily an error condition.
if (GetLastError() != ERROR_BROKEN_PIPE) {
errorText = "Error reading from the child process: ";
errorText += getErrorText();
}
break;
}
#else

Loading…
Отказ
Запис