svn commit: r325420 - head/contrib/llvm/lib/Support/Unix

Ed Maste emaste at FreeBSD.org
Sun Nov 5 00:51:54 UTC 2017


Author: emaste
Date: Sun Nov  5 00:51:53 2017
New Revision: 325420
URL: https://svnweb.freebsd.org/changeset/base/325420

Log:
  lld: accept EINVAL to indicate posix_fallocate is unsupported
  
  As of r325320 posix_fallocate on a ZFS filesystem returns EINVAL to
  indicate that the operation is not supported. (I think this is a strange
  choice of errno on the part of POSIX.)
  
  PR:		223383, 223440
  Reported by:	Mark Millard
  Tested by:	Mark Millard
  MFC after:	3 days
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/contrib/llvm/lib/Support/Unix/Path.inc

Modified: head/contrib/llvm/lib/Support/Unix/Path.inc
==============================================================================
--- head/contrib/llvm/lib/Support/Unix/Path.inc	Sun Nov  5 00:26:28 2017	(r325419)
+++ head/contrib/llvm/lib/Support/Unix/Path.inc	Sun Nov  5 00:51:53 2017	(r325420)
@@ -427,7 +427,7 @@ std::error_code resize_file(int FD, uint64_t Size) {
   // 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 != EOPNOTSUPP)
+    if (Err != EINVAL && Err != EOPNOTSUPP)
       return std::error_code(Err, std::generic_category());
   }
 #endif


More information about the svn-src-all mailing list