summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Lanza <nathan@lanza.io>2019-07-19 00:40:37 +0000
committerNathan Lanza <nathan@lanza.io>2019-07-19 00:40:37 +0000
commitcb30520555da15bced842965757b4e0a5ed772d8 (patch)
treeddf84a328343721cac971b8a5d873aee0d7af889
parentbb0896970afab6267f606353c90279c624e91d37 (diff)
downloadbcm5719-llvm-cb30520555da15bced842965757b4e0a5ed772d8.tar.gz
bcm5719-llvm-cb30520555da15bced842965757b4e0a5ed772d8.zip
check for interrupt from fgets on Windows
Windows does not have the error EINTR when a blocking syscall is interrupted by a signal. The ReadFile API that fgets is implemented with instead use ERROR_OPERATION_ABORTED. Check for that after fgets. llvm-svn: 366520
-rw-r--r--lldb/source/Core/IOHandler.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lldb/source/Core/IOHandler.cpp b/lldb/source/Core/IOHandler.cpp
index b30308490cc..e3fb5052990 100644
--- a/lldb/source/Core/IOHandler.cpp
+++ b/lldb/source/Core/IOHandler.cpp
@@ -383,6 +383,9 @@ bool IOHandlerEditline::GetLine(std::string &line, bool &interrupted) {
// fgets twice until this bug is fixed.
if (fgets(buffer, sizeof(buffer), in) == nullptr &&
fgets(buffer, sizeof(buffer), in) == nullptr) {
+ // this is the equivalent of EINTR for Windows
+ if (GetLastError() == ERROR_OPERATION_ABORTED)
+ continue;
#else
if (fgets(buffer, sizeof(buffer), in) == nullptr) {
#endif
OpenPOWER on IntegriCloud