summaryrefslogtreecommitdiff
path: root/sysutils/vifm/patches/patch-src_utils_mntent.c
blob: 09f027b6017636a96f4df2aba9464a699f7644a3 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
$NetBSD: patch-src_utils_mntent.c,v 1.2 2017/02/01 14:17:21 mef Exp $

* I have no idea how to test this...

--- src/compat/mntent.c.orig	2015-10-09 01:52:00.000000000 +0900
+++ src/compat/mntent.c	2017-02-01 22:41:54.000000000 +0900
@@ -53,7 +53,7 @@
 #define f_flags f_flag
 #endif
 
-static struct mntent * statfs_to_mntent(struct statfs *mntbuf);
+static struct mntent * statvfs_to_mntent(struct statfs *mntbuf);
 static char * flags2opts(int flags);
 static char * catopt(char s0[], const char s1[]);
 
@@ -82,7 +82,7 @@ getmntent(FILE *fp)
 	static int pos = -1;
 	static int mntsize = -1;
 
-	static struct statfs *mntbuf;
+	static struct statvfs *mntbuf;
 
 	if(pos == -1 || mntsize == -1)
 	{
@@ -96,11 +96,11 @@ getmntent(FILE *fp)
 		return NULL;
 	}
 
-	return statfs_to_mntent(&mntbuf[pos]);
+	return statvfs_to_mntent(&mntbuf[pos]);
 }
 
 static struct mntent *
-statfs_to_mntent(struct statfs *mntbuf)
+statvfs_to_mntent(struct statvfs *mntbuf)
 {
 	static struct mntent _mntent;
 	static char opts_buf[40], *tmp;
@@ -108,7 +108,7 @@ statfs_to_mntent(struct statfs *mntbuf)
 	_mntent.mnt_fsname = mntbuf->f_mntfromname;
 	_mntent.mnt_dir = mntbuf->f_mntonname;
 	_mntent.mnt_type = mntbuf->f_fstypename;
-	tmp = flags2opts (mntbuf->f_flags);
+	tmp = flags2opts (mntbuf->f_flag);
 	if(tmp != NULL)
 	{
 		opts_buf[sizeof(opts_buf) - 1] = '\0';