diff --git a/buildtool.cpp b/buildtool.cpp
index 53f3fc9570a7585ca37eb356ab1d812a0ce396e7..bc6da92d3b6b9865603d5357203e57713dea1646 100644 (file)
--- a/buildtool.cpp
+++ b/buildtool.cpp
bool outOpen = true;
bool errOpen = true;
- while (outOpen && errOpen)
+ while (outOpen || errOpen)
{
char ch;
fd_set fdset;
break;
if (FD_ISSET(outRead, &fdset))
{
- if (read(outRead, &ch, 1) <= 0 || ch <= 0)
+ if (read(outRead, &ch, 1) <= 0)
+ outOpen = false;
+ else if (ch <= 0)
outOpen = false;
else
outb.push_back(ch);
}
if (FD_ISSET(errRead, &fdset))
{
- if (read(errRead, &ch, 1) <= 0 || ch <= 0)
+ if (read(errRead, &ch, 1) <= 0)
+ errOpen = false;
+ else if (ch <= 0)
errOpen = false;
else
errb.push_back(ch);