[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
Thu Aug 19 11:39:04 PDT 2021


muiez updated this revision to Diff 367565.
muiez added a comment.

No change. Uploaded diff with full context


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.367565.patch
Type: text/x-patch
Size: 981 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210819/2a23862c/attachment.bin>


More information about the libcxx-commits mailing list