summaryrefslogtreecommitdiffstats
path: root/mtab.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2019-09-24 21:29:03 -0400
committerTavian Barnes <tavianator@tavianator.com>2019-09-24 21:29:03 -0400
commitf29632efd87b403fadcecff1d19b0be7bf90af84 (patch)
tree57e4595194311d2c0052438401c7949ea8b8e7df /mtab.c
parenta7f72ec05af19394a38dd5a4c16c71c5ee622209 (diff)
downloadbfs-f29632efd87b403fadcecff1d19b0be7bf90af84.tar.xz
mtab: Use struct statvfs on NetBSD
Fixes #53.
Diffstat (limited to 'mtab.c')
-rw-r--r--mtab.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/mtab.c b/mtab.c
index fd2d71e..70152cd 100644
--- a/mtab.c
+++ b/mtab.c
@@ -140,14 +140,20 @@ struct bfs_mtab *parse_bfs_mtab() {
#elif BFS_MNTINFO
- struct statfs *mntbuf;
+#if __NetBSD__
+ typedef struct statvfs bfs_statfs;
+#else
+ typedef struct statfs bfs_statfs;
+#endif
+
+ bfs_statfs *mntbuf;
int size = getmntinfo(&mntbuf, MNT_WAIT);
if (size < 0) {
error = errno;
goto fail;
}
- for (struct statfs *mnt = mntbuf; mnt < mntbuf + size; ++mnt) {
+ for (bfs_statfs *mnt = mntbuf; mnt < mntbuf + size; ++mnt) {
if (bfs_mtab_add(mtab, mnt->f_mntonname, mnt->f_fstypename) != 0) {
error = errno;
goto fail;