Просмотр исходного кода

Check for EXIT_SUCCESS after calling ReadFile().

adeniz_1
Alban Deniz 4 месяцев назад
Родитель
Сommit
00018783af
1 измененных файлов: 8 добавлений и 4 удалений
  1. 8
    4
      child.cpp

+ 8
- 4
child.cpp Просмотреть файл

@@ -1456,7 +1456,7 @@ namespace CodeDweller {
// Blocking read from the child.
#ifdef _WIN32
DWORD nBytesRead;
DWORD nBytesRead, lastError;
try {
@@ -1492,7 +1492,9 @@ namespace CodeDweller {
// Broken pipe occurs when the child exits; this is not
// necessarily an error condition.
if (GetLastError() != ERROR_BROKEN_PIPE) {
lastError = GetLastError();
if ( (ERROR_BROKEN_PIPE != lastError) &&
(ERROR_SUCCESS != lastError) ){
errorText = "Error reading from the child process: ";
errorText += getErrorText();
@@ -1513,9 +1515,11 @@ namespace CodeDweller {
// Thread was not commanded to stop; output error: Broken pipe
// occurs when the child exits; this is not an error
// condition.
if (GetLastError() != ERROR_BROKEN_PIPE) {
lastError = GetLastError();
if ( (ERROR_BROKEN_PIPE != lastError) &&
(ERROR_SUCCESS != lastError) ){
errorText = "Error reading from the child process: ";
errorText = "Exception when reading from the child process: ";
errorText += getErrorText();
}

Загрузка…
Отмена
Сохранить