mirror of https://github.com/Icinga/icinga2.git
Process: repeat read() until we get EAGAIN.
This commit is contained in:
parent
a80872b314
commit
b0d8c40d20
|
@ -380,6 +380,7 @@ bool Process::RunTask(void)
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
|
do {
|
||||||
rc = read(m_FD, buffer, sizeof(buffer));
|
rc = read(m_FD, buffer, sizeof(buffer));
|
||||||
#else /* _MSC_VER */
|
#else /* _MSC_VER */
|
||||||
if (!feof(m_FP))
|
if (!feof(m_FP))
|
||||||
|
@ -390,9 +391,16 @@ bool Process::RunTask(void)
|
||||||
|
|
||||||
if (rc > 0) {
|
if (rc > 0) {
|
||||||
m_OutputStream.write(buffer, rc);
|
m_OutputStream.write(buffer, rc);
|
||||||
|
#ifdef _MSC_VER
|
||||||
return true;
|
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();
|
String output = m_OutputStream.str();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue