[Host] File::GetWaitableHandle() should call fileno()
authorJonas Devlieghere <jonas@devlieghere.com>
Mon, 23 Sep 2019 19:34:26 +0000 (19:34 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Mon, 23 Sep 2019 19:34:26 +0000 (19:34 +0000)
commita7d186c796455fd5fc400c4b06e4b70554b77353
tree6034fdc4d98c1c12fe2fdffb238b4600260df494
parent869ef0a627952545437fab77c3b97854a189625b
[Host] File::GetWaitableHandle() should call fileno()

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.

Patch by: Lawrence D'Anna

Differential revision: https://reviews.llvm.org/D67789

llvm-svn: 372644
lldb/source/Host/common/File.cpp
lldb/unittests/Host/CMakeLists.txt
lldb/unittests/Host/FileTest.cpp [new file with mode: 0644]