[PATCH] D48250: [sanitizer_common] Use O_TRUNC for WrOnly access mode.

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 15 18:32:44 PDT 2018


vitalybuka added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_posix.cc:163
     case RdOnly: flags = O_RDONLY; break;
-    case WrOnly: flags = O_WRONLY | O_CREAT; break;
+    case WrOnly: flags = O_WRONLY | O_CREAT | O_TRUNC; break;
     case RdWr: flags = O_RDWR | O_CREAT; break;
----------------
please also fix  
compiler-rt/lib/sanitizer_common/sanitizer_rtems.cc

windows looks good
compiler-rt/lib/sanitizer_common/sanitizer_win.cc


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D48250





More information about the llvm-commits mailing list