From f29632efd87b403fadcecff1d19b0be7bf90af84 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 24 Sep 2019 21:29:03 -0400 Subject: mtab: Use struct statvfs on NetBSD Fixes #53. --- mtab.c | 10 ++++++++-- 1 file 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; -- cgit v1.2.3