[Xfce4-commits] <exo:xfce-4.6> Prefer getvfsstat over getfsstat (bug #3718).
Nick Schermer
nick at xfce.org
Thu Aug 20 20:40:03 CEST 2009
Updating branch refs/heads/xfce-4.6
to 24490e0687fc0bdd6766ac93d3851d887448e7f5 (commit)
from f150c7d57a74df5b8efd9416a6de07e6c5301e33 (commit)
commit 24490e0687fc0bdd6766ac93d3851d887448e7f5
Author: Nick Schermer <nick at xfce.org>
Date: Thu Aug 20 19:39:02 2009 +0200
Prefer getvfsstat over getfsstat (bug #3718).
exo/exo-mount-point.c | 48 ++++++++++++++++++++++++------------------------
1 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/exo/exo-mount-point.c b/exo/exo-mount-point.c
index d98d529..1b805ff 100644
--- a/exo/exo-mount-point.c
+++ b/exo/exo-mount-point.c
@@ -253,57 +253,57 @@ exo_mount_point_list_match_active (ExoMountPointMatchMask mask,
/* 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) /* 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 */
More information about the Xfce4-commits
mailing list