[libcxx-commits] [libcxx] 25aa0d1 - [SystemZ][ZOS] Guard using declaration for ::fchmodat

Zbigniew Sarbinowski via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 18 07:01:28 PST 2021


Author: Zbigniew Sarbinowski
Date: 2021-02-18T15:01:04Z
New Revision: 25aa0d12445eed6e278489546d18fcb7a33cfaa6

URL: https://github.com/llvm/llvm-project/commit/25aa0d12445eed6e278489546d18fcb7a33cfaa6
DIFF: https://github.com/llvm/llvm-project/commit/25aa0d12445eed6e278489546d18fcb7a33cfaa6.diff

LOG: [SystemZ][ZOS] Guard using declaration for ::fchmodat

The use of fchmodat() is beeing guarded but its using declaration is not. Let's use the same guard in both places to avoid compiler errors on platforms where `fchmodat` does not exist.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D96303

Added: 
    

Modified: 
    libcxx/src/filesystem/posix_compat.h

Removed: 
    


################################################################################
diff  --git a/libcxx/src/filesystem/posix_compat.h b/libcxx/src/filesystem/posix_compat.h
index 8062bd65ce00..f5c8ec39df2b 100644
--- a/libcxx/src/filesystem/posix_compat.h
+++ b/libcxx/src/filesystem/posix_compat.h
@@ -487,7 +487,9 @@ int symlink_dir(const char *oldname, const char *newname) {
 using ::chdir;
 using ::close;
 using ::fchmod;
+#if defined(AT_SYMLINK_NOFOLLOW) && defined(AT_FDCWD)
 using ::fchmodat;
+#endif
 using ::fstat;
 using ::ftruncate;
 using ::getcwd;


        


More information about the libcxx-commits mailing list