Fixed a case where we could spin indefinitely if we got an error from fgets that isn't EINTR.

<rdar://problem/16535437>

llvm-svn: 205740
This commit is contained in:
Greg Clayton 2014-04-07 21:37:59 +00:00
parent 78d1019703
commit c7797accb8
1 changed files with 6 additions and 0 deletions

View File

@ -410,8 +410,14 @@ IOHandlerEditline::GetLine (std::string &line)
{
if (fgets(buffer, sizeof(buffer), in) == NULL)
{
const int saved_errno = errno;
if (feof(in))
done = true;
else if (ferror(in))
{
if (saved_errno != EINTR)
done = true;
}
}
else
{