[Lldb-commits] [PATCH] D67789: bugfix: File::GetWaitableHandle() should call fileno()

Lawrence D'Anna via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 19 21:12:12 PDT 2019


lawrence_danna created this revision.
lawrence_danna added reviewers: JDevlieghere, jasonmolenda.
Herald added a project: LLDB.

If the file has m_stream, it may not have a m_descriptor.
GetWaitableHandle() should call GetDescriptor(), which will call
fileno(), so it will get waitable descriptor whenever one is available.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D67789

Files:
  lldb/source/Host/common/File.cpp


Index: lldb/source/Host/common/File.cpp
===================================================================
--- lldb/source/Host/common/File.cpp
+++ lldb/source/Host/common/File.cpp
@@ -91,7 +91,7 @@
   return kInvalidDescriptor;
 }
 
-IOObject::WaitableHandle File::GetWaitableHandle() { return m_descriptor; }
+IOObject::WaitableHandle File::GetWaitableHandle() { return GetDescriptor(); }
 
 void File::SetDescriptor(int fd, bool transfer_ownership) {
   if (IsValid())


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67789.220939.patch
Type: text/x-patch
Size: 473 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190920/de71f265/attachment.bin>


More information about the lldb-commits mailing list