[PATCH] D36529: Fixed a race condition in PrecompiledPreamble.

Manuel Klimek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 10 03:18:31 PDT 2017


klimek added inline comments.


================
Comment at: lib/Frontend/PrecompiledPreamble.cpp:470-471
+  int FD;
+  auto EC = llvm::sys::fs::createTemporaryFile(Prefix, Suffix, /*ref*/ FD,
+                                               /*ref*/ File);
   if (EC)
----------------
I don't understand that yet - why does keeping the file open around the EC check change any of the behavior?
Generally, both create the file, right? So only the first one should get no error?


https://reviews.llvm.org/D36529





More information about the cfe-commits mailing list