This is an archive of the discontinued LLVM Phabricator instance.

Don't close handle returned by _get_osfhandle
ClosedPublic

Authored by ovyalov on May 21 2015, 8:59 PM.

Details

Summary

Apparently, there is no need to close handle that is returned by _get_osfhandle - it should be closed anyway than original handle is closed.

Diff Detail

Event Timeline

ovyalov updated this revision to Diff 26304.May 21 2015, 8:59 PM
ovyalov retitled this revision from to Don't close handle returned by _get_osfhandle.
ovyalov updated this object.
ovyalov edited the test plan for this revision. (Show Details)
ovyalov added reviewers: zturner, aidan.dodds.
ovyalov added a subscriber: Unknown Object (MLST).

Aidan, could you let me know whether this patch prevents lldb from crashing on Windows?

ADodds accepted this revision.Jun 1 2015, 3:36 AM
ADodds added a reviewer: ADodds.
ADodds added a subscriber: ADodds.

Hi Oleksiy,

I tested your patch this morning and it does indeed fix the crash we have been seeing.
I still feel it would be nice to tie the LockFileWindows to the lifetime of the File object who's handle its using, but perhaps we can address that if the issue arises.

Thanks,
Aidan

This revision is now accepted and ready to land.Jun 1 2015, 3:36 AM

Hi Oleksiy,

I tested your patch this morning and it does indeed fix the crash we have been seeing.
I still feel it would be nice to tie the LockFileWindows to the lifetime of the File object who's handle its using, but perhaps we can address that if the issue arises.

Thanks,
Aidan

Hi Aidan,

totally makes sense - with this CL I just wanted to fix an ongoing issue that you're facing.

Thank you.

ovyalov closed this revision.Jun 1 2015, 11:57 AM

AFFECTED FILES

/lldb/trunk/source/Host/windows/LockFileWindows.cpp

USERS

ovyalov (Author)

http://reviews.llvm.org/rL238770