blob: 64e395bf60b82ad1a623b9fec83042dbbfb3b399 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
$NetBSD: patch-mtab.c,v 1.2 2019/12/15 12:29:01 mef Exp $
Support NetBSD's spelling of statfs.
--- mtab.c.orig 2019-09-15 03:10:39.000000000 +0900
+++ mtab.c 2019-12-15 21:00:33.122336837 +0900
@@ -140,14 +140,21 @@ struct bfs_mtab *parse_bfs_mtab() {
#elif BFS_MNTINFO
+#ifdef __NetBSD__
+ struct statvfs *mntbuf;
+#else
struct statfs *mntbuf;
+#endif
int size = getmntinfo(&mntbuf, MNT_WAIT);
if (size < 0) {
error = errno;
goto fail;
}
-
+#ifdef __NetBSD__
+ for (struct statvfs *mnt = mntbuf; mnt < mntbuf + size; ++mnt) {
+#else
for (struct statfs *mnt = mntbuf; mnt < mntbuf + size; ++mnt) {
+#endif
if (bfs_mtab_add(mtab, mnt->f_mntonname, mnt->f_fstypename) != 0) {
error = errno;
goto fail;
|