Page MenuHomePhabricator

bugfix: File::GetWaitableHandle() should call fileno()

Authored by lawrence_danna on Sep 19 2019, 9:12 PM.



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.

Diff Detail


Event Timeline

lawrence_danna created this revision.Sep 19 2019, 9:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 19 2019, 9:12 PM
labath added a subscriber: labath.Sep 20 2019, 5:20 AM

Thanks for the fix. This sounds like it should be unit testable. Could add a test for that?

added a unit test

labath accepted this revision.Sep 23 2019, 12:43 AM

Thanks for adding the test. LGTM, modulo some nits inline.

14 ↗(On Diff #221082)

Please keep the list sorted.

29–32 ↗(On Diff #221082)

nit: change EXPECT_XXX to ASSERT_XXX as it does not make sense to continue the test if the assertions are not true.

This revision is now accepted and ready to land.Sep 23 2019, 12:43 AM
lawrence_danna marked 2 inline comments as done.Sep 23 2019, 12:20 PM

nits fixed

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 23 2019, 12:32 PM