forked from OSchip/llvm-project
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:
parent
78d1019703
commit
c7797accb8
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue