diff options
author | Antoine Jacoutot <ajacoutot@gnome.org> | 2012-09-30 10:52:39 +0200 |
---|---|---|
committer | Antoine Jacoutot <ajacoutot@gnome.org> | 2012-10-01 12:52:04 +0200 |
commit | 28499561527f6ce25f42f1c2bb44fd170a7fc5e0 (patch) | |
tree | 72fe2e9e8b588ca3d3ca0bd2cc1f894c5c8c6cb9 | |
parent | 8c1da6dce157221dabf5ec916fa7d076068b9d13 (diff) | |
download | gvfs-28499561527f6ce25f42f1c2bb44fd170a7fc5e0.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
(cherry picked from commit a5e21447be3c138969e80a3f779c8697b551db4f)
-rw-r--r-- | metadata/metatree.c | 4 |
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); |