diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2019-09-24 21:29:03 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2019-09-24 21:29:03 -0400 |
commit | f29632efd87b403fadcecff1d19b0be7bf90af84 (patch) | |
tree | 57e4595194311d2c0052438401c7949ea8b8e7df | |
parent | a7f72ec05af19394a38dd5a4c16c71c5ee622209 (diff) | |
download | bfs-f29632efd87b403fadcecff1d19b0be7bf90af84.tar.xz |
mtab: Use struct statvfs on NetBSD
Fixes #53.
-rw-r--r-- | mtab.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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; |