[PATCH] D63583: [Support] Add fs::getUmask() function and change fs::setPermissions

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 21 17:37:33 PDT 2019


rupprecht accepted this revision.
rupprecht added inline comments.


================
Comment at: llvm/include/llvm/Support/FileSystem.h:654-656
+/// @note There is no umask on Windows. This function returns 0 always
+///       on Windows. This function does not return an error_code because
+///       umask(2) never fails.
----------------
Also note that it is not threadsafe


================
Comment at: llvm/lib/Support/Unix/Path.inc:695
+unsigned getUmask() {
+  // Chose arbitary new mask and ret set the umask to the old mask.
+  // umask(2) never fails so ignore the return of the second call.
----------------
nit: ret set -> reset


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63583/new/

https://reviews.llvm.org/D63583





More information about the llvm-commits mailing list