This is an archive of the discontinued LLVM Phabricator instance.

Use O_BINARY when opening GCDA file on Windows
ClosedPublic

Authored by marco-c on Oct 16 2017, 5:14 PM.

Details

Summary

Fixes https://bugs.llvm.org/show_bug.cgi?id=34922.

Apparently, the mode in fdopen gets simply ignored and Windows only cares about the mode of the original open.

I have verified this both with the simple case from bug 34922 and with a full Firefox build.

Diff Detail

Event Timeline

marco-c created this revision.Oct 16 2017, 5:14 PM
marco-c updated this revision to Diff 119299.Oct 17 2017, 6:01 AM
marco-c retitled this revision from Use fopen instead of fdopen for opening GCDA files as fdopen seems to cause files to get corrupted to Use O_BINARY when opening GCDA file on Windows.
marco-c edited the summary of this revision. (Show Details)

Replaced fopen with fdopen again, added O_BINARY when originally opening file with open.

zturner accepted this revision.Oct 17 2017, 10:46 AM
This revision is now accepted and ready to land.Oct 17 2017, 10:46 AM
marco-c closed this revision.Oct 17 2017, 5:22 PM