summaryrefslogtreecommitdiff
path: root/metadata
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@gnome.org>2012-09-30 10:52:39 +0200
committerAntoine Jacoutot <ajacoutot@gnome.org>2012-10-01 12:51:02 +0200
commita5e21447be3c138969e80a3f779c8697b551db4f (patch)
tree1333b11d478c6edf647787e564d6f259456628fe /metadata
parentf271c7fccfaf1e5cb25f06c85734991b2c07b673 (diff)
downloadgvfs-a5e21447be3c138969e80a3f779c8697b551db4f.tar.gz
portability: fix is_on_nfs on OpenBSD
Under OpenBSD, the statfs structure does not support "f_type". So, use "f_fstypename" to check for NFS. https://bugzilla.gnome.org/show_bug.cgi?id=685126
Diffstat (limited to 'metadata')
-rw-r--r--metadata/metatree.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/metadata/metatree.c b/metadata/metatree.c
index 850866e9..3bcf9a60 100644
--- a/metadata/metatree.c
+++ b/metadata/metatree.c
@@ -302,7 +302,11 @@ is_on_nfs (char *filename)
sizeof (statfs_buffer), 0);
# endif
if (statfs_result == 0)
+#ifdef __OpenBSD__
+ res = strcmp(statfs_buffer.f_fstypename, MOUNT_NFS) == 0;
+#else
res = statfs_buffer.f_type == 0x6969;
+#endif
#elif defined(USE_STATVFS) && defined(HAVE_STRUCT_STATVFS_F_BASETYPE)
statfs_result = statvfs (dirname, &statfs_buffer);