[PATCH] D60175: [Support] On AIX, Check ENOTSUP on posix_fallocate instead of EOPNOTSUPP

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 3 17:40:48 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL357662: [Support] On AIX, Check ENOTSUP on posix_fallocate instead of EOPNOTSUPP (authored by hubert.reinterpretcast, committed by ).

Repository:
  rL LLVM

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

https://reviews.llvm.org/D60175

Files:
  llvm/trunk/lib/Support/Unix/Path.inc


Index: llvm/trunk/lib/Support/Unix/Path.inc
===================================================================
--- llvm/trunk/lib/Support/Unix/Path.inc
+++ llvm/trunk/lib/Support/Unix/Path.inc
@@ -492,7 +492,12 @@
   // If we have posix_fallocate use it. Unlike ftruncate it always allocates
   // space, so we get an error if the disk is full.
   if (int Err = ::posix_fallocate(FD, 0, Size)) {
-    if (Err != EINVAL && Err != EOPNOTSUPP)
+#ifdef _AIX
+    constexpr int NotSupportedError = ENOTSUP;
+#else
+    constexpr int NotSupportedError = EOPNOTSUPP;
+#endif
+    if (Err != EINVAL && Err != NotSupportedError)
       return std::error_code(Err, std::generic_category());
   }
 #endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60175.193637.patch
Type: text/x-patch
Size: 695 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190404/721e02dd/attachment.bin>


More information about the llvm-commits mailing list