[libcxx-commits] [PATCH] D108326: [SystemZ][z/OS] Fix handling of dirs with filesystem tests

Muiez Ahmed via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Dec 13 08:02:37 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGb8c12af9dd76: [SystemZ][z/OS] Fix handling of dirs with filesystem tests (authored by muiez).

Changed prior to commit:
  https://reviews.llvm.org/D108326?vs=367565&id=393902#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108326

Files:
  libcxx/test/support/filesystem_test_helper.h


Index: libcxx/test/support/filesystem_test_helper.h
===================================================================
--- libcxx/test/support/filesystem_test_helper.h
+++ libcxx/test/support/filesystem_test_helper.h
@@ -138,12 +138,18 @@
         std::string cmd = "rmdir /s /q " + test_root.string();
         int ret = std::system(cmd.c_str());
         assert(ret == 0);
+#else
+#if defined(__MVS__)
+        // The behaviour of chmod -R on z/OS prevents recursive
+        // permission change for directories that do not have read permission.
+        std::string cmd = "find  " + test_root.string() + " -exec chmod 777 {} \\;";
 #else
         std::string cmd = "chmod -R 777 " + test_root.string();
+#endif // defined(__MVS__)
         int ret = std::system(cmd.c_str());
         assert(ret == 0);
 
-        cmd = "rm -r " + test_root.string();
+        cmd = "rm -rf " + test_root.string();
         ret = std::system(cmd.c_str());
         assert(ret == 0);
 #endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108326.393902.patch
Type: text/x-patch
Size: 979 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211213/43c221a4/attachment.bin>


More information about the libcxx-commits mailing list