Process: repeat read() until we get EAGAIN.

This commit is contained in:
Gunnar Beutner 2013-02-13 07:39:26 +01:00
parent a80872b314
commit b0d8c40d20
1 changed files with 16 additions and 8 deletions

View File

@ -380,6 +380,7 @@ bool Process::RunTask(void)
int rc;
#ifndef _MSC_VER
do {
rc = read(m_FD, buffer, sizeof(buffer));
#else /* _MSC_VER */
if (!feof(m_FP))
@ -390,9 +391,16 @@ bool Process::RunTask(void)
if (rc > 0) {
m_OutputStream.write(buffer, rc);
#ifdef _MSC_VER
return true;
#endif /* _MSC_VER */
}
#ifndef _MSC_VER
} while (rc > 0);
if (rc < 0 && errno == EAGAIN)
return true;
#endif /* _MSC_VER */
String output = m_OutputStream.str();