[llvm] r304412 - [Solaris] Fix PR33228 - llvm::sys::fs::is_local_impl done right

Kamil Rytarowski via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 1 05:57:00 PDT 2017


Author: kamil
Date: Thu Jun  1 07:57:00 2017
New Revision: 304412

URL: http://llvm.org/viewvc/llvm-project?rev=304412&view=rev
Log:
[Solaris] Fix PR33228 - llvm::sys::fs::is_local_impl done right

Summary:
Solaris-specific implementation for llvm::sys::fs::is_local_impl.
FStype pattern matching might be a bit unreliable, but at least it fixes the build failure.



Reviewers: mgorny, nlopes, llvm-commits, krytarowski

Reviewed By: krytarowski

Subscribers: voskresensky.vladimir, krytarowski

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

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

Modified: llvm/trunk/lib/Support/Unix/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Path.inc?rev=304412&r1=304411&r2=304412&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Path.inc (original)
+++ llvm/trunk/lib/Support/Unix/Path.inc Thu Jun  1 07:57:00 2017
@@ -381,6 +381,11 @@ static bool is_local_impl(struct STATVFS
 #elif defined(__CYGWIN__)
   // Cygwin doesn't expose this information; would need to use Win32 API.
   return false;
+#elif defined(__sun)
+  // statvfs::f_basetype contains a null-terminated FSType name of the mounted target
+  StringRef fstype(Vfs.f_basetype);
+  // NFS is the only non-local fstype??
+  return !fstype.equals("nfs");
 #else
   return !!(STATVFS_F_FLAG(Vfs) & MNT_LOCAL);
 #endif




More information about the llvm-commits mailing list