[gvfs] portability: fix is_on_nfs on OpenBSD
- From: Antoine Jacoutot <ajacoutot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] portability: fix is_on_nfs on OpenBSD
- Date: Mon, 1 Oct 2012 10:51:22 +0000 (UTC)
commit a5e21447be3c138969e80a3f779c8697b551db4f
Author: Antoine Jacoutot <ajacoutot gnome org>
Date: Sun Sep 30 10:52:39 2012 +0200
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
metadata/metatree.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/metadata/metatree.c b/metadata/metatree.c
index 850866e..3bcf9a6 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]