mirror of
https://github.com/intel/llvm.git
synced 2026-01-19 09:31:59 +08:00
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:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user