aboutsummaryrefslogtreecommitdiff
path: root/openbsd-compat/bsd-statvfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-compat/bsd-statvfs.c')
-rw-r--r--openbsd-compat/bsd-statvfs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/openbsd-compat/bsd-statvfs.c b/openbsd-compat/bsd-statvfs.c
index 458dbe89c16c..e3bd87d985a3 100644
--- a/openbsd-compat/bsd-statvfs.c
+++ b/openbsd-compat/bsd-statvfs.c
@@ -25,6 +25,10 @@
#include <errno.h>
+#ifndef MNAMELEN
+# define MNAMELEN 32
+#endif
+
static void
copy_statfs_to_statvfs(struct statvfs *to, struct statfs *from)
{
@@ -37,7 +41,11 @@ copy_statfs_to_statvfs(struct statvfs *to, struct statfs *from)
to->f_ffree = from->f_ffree;
to->f_favail = from->f_ffree; /* no exact equivalent */
to->f_fsid = 0; /* XXX fix me */
+#ifdef HAVE_STRUCT_STATFS_F_FLAGS
to->f_flag = from->f_flags;
+#else
+ to->f_flag = 0;
+#endif
to->f_namemax = MNAMELEN;
}