HomePhabricator

[Support] PR42623: Avoid setting the delete-on-close bit if a TempFile doesn't…

Authored by rdwampler on Sep 28 2020, 2:07 PM.

Description

[Support] PR42623: Avoid setting the delete-on-close bit if a TempFile doesn't reside on a local drive

On Windows, after commit 881ba104656c40098d4bc90c52613c08136f0fe1, tools
using TempFile would error with "bad file descriptor" when writing the
file on a network drive. It appears that setting the delete-on-close bit via
SetFileInformationByHandle/FileDispositionInfo prevented it from
accessing the file on network drives, and although using
FILE_DISPOSITION_INFO seems to work, it causes other troubles.

Differential Revision: https://reviews.llvm.org/D81803