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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
$NetBSD: patch-ad,v 1.4 2008/07/01 13:41:08 obache Exp $
--- exo/exo-mount-point.c.orig 2007-12-02 14:33:44 +0200
+++ exo/exo-mount-point.c 2008-06-06 15:14:00 +0300
@@ -253,57 +253,57 @@ exo_mount_point_list_match_active (ExoMo
/* close the file handle */
fclose (fp);
-#elif defined(HAVE_GETFSSTAT) /* FreeBSD, OpenBSD, DragonFly, older NetBSD */
- struct statfs *mntbuf = NULL;
- glong bufsize = 0;
- gint mntsize;
- gint n;
+#elif defined(HAVE_GETVFSSTAT) && !defined(__DragonFly__) /* Newer NetBSD */
+ struct statvfs *mntbuf = NULL;
+ glong bufsize = 0;
+ gint mntsize;
+ gint n;
/* determine the number of active mount points */
- mntsize = getfsstat (NULL, 0, MNT_NOWAIT);
+ mntsize = getvfsstat (NULL, 0, MNT_NOWAIT);
if (G_LIKELY (mntsize > 0))
{
/* allocate a new buffer */
bufsize = (mntsize + 4) * sizeof (*mntbuf);
- mntbuf = (struct statfs *) malloc (bufsize);
+ mntbuf = (struct statvfs *) malloc (bufsize);
/* determine the mount point for the device file */
- mntsize = getfsstat (mntbuf, bufsize, MNT_NOWAIT);
+ mntsize = getvfsstat (mntbuf, bufsize, ST_NOWAIT);
for (n = 0; n < mntsize; ++n)
{
/* check if we have a match here */
- exo_mount_point_add_if_matches (mask, device, folder, fstype, mntbuf[n].f_mntfromname, mntbuf[n].f_mntonname,
- mntbuf[n].f_fstypename, ((mntbuf[n].f_flags & MNT_RDONLY) != 0), &mount_points);
+ exo_mount_point_add_if_matches (mask, device, folder, fstype,
+ mntbuf[n].f_mntfromname,
+ mntbuf[n].f_mntonname,
+ mntbuf[n].f_fstypename,
+ ((mntbuf[n].f_flag & MNT_RDONLY) != 0),
+ &mount_points);
}
/* release the buffer */
free (mntbuf);
}
-#elif defined(HAVE_GETVFSSTAT) /* Newer NetBSD */
- struct statvfs *mntbuf = NULL;
- glong bufsize = 0;
- gint mntsize;
- gint n;
+#elif defined(HAVE_GETFSSTAT) /* FreeBSD, OpenBSD, DragonFly, older NetBSD */
+ struct statfs *mntbuf = NULL;
+ glong bufsize = 0;
+ gint mntsize;
+ gint n;
/* determine the number of active mount points */
- mntsize = getvfsstat (NULL, 0, MNT_NOWAIT);
+ mntsize = getfsstat (NULL, 0, MNT_NOWAIT);
if (G_LIKELY (mntsize > 0))
{
/* allocate a new buffer */
bufsize = (mntsize + 4) * sizeof (*mntbuf);
- mntbuf = (struct statvfs *) malloc (bufsize);
+ mntbuf = (struct statfs *) malloc (bufsize);
/* determine the mount point for the device file */
- mntsize = getvfsstat (mntbuf, bufsize, ST_NOWAIT);
+ mntsize = getfsstat (mntbuf, bufsize, MNT_NOWAIT);
for (n = 0; n < mntsize; ++n)
{
/* check if we have a match here */
- exo_mount_point_add_if_matches (mask, device, folder, fstype,
- mntbuf[n].f_mntfromname,
- mntbuf[n].f_mntonname,
- mntbuf[n].f_fstypename,
- ((mntbuf[n].f_flag & MNT_RDONLY) != 0),
- &mount_points);
+ exo_mount_point_add_if_matches (mask, device, folder, fstype, mntbuf[n].f_mntfromname, mntbuf[n].f_mntonname,
+ mntbuf[n].f_fstypename, ((mntbuf[n].f_flags & MNT_RDONLY) != 0), &mount_points);
}
/* release the buffer */
|