Author: benny
Date: 2007-02-12 19:05:16 +0000 (Mon, 12 Feb 2007)
New Revision: 24962
Modified:
libexo/trunk/ChangeLog
libexo/trunk/configure.in.in
libexo/trunk/exo/exo-mount-point.c
Log:
2007-02-12 Benedikt Meurer <[EMAIL PROTECTED]>
* configure.in.in, exo/exo-mount-point.c: Fix compilation on newer
NetBSD versions. Bug #2808.
Modified: libexo/trunk/ChangeLog
===================================================================
--- libexo/trunk/ChangeLog 2007-02-12 18:49:41 UTC (rev 24961)
+++ libexo/trunk/ChangeLog 2007-02-12 19:05:16 UTC (rev 24962)
@@ -1,5 +1,10 @@
2007-02-12 Benedikt Meurer <[EMAIL PROTECTED]>
+ * configure.in.in, exo/exo-mount-point.c: Fix compilation on newer
+ NetBSD versions. Bug #2808.
+
+2007-02-12 Benedikt Meurer <[EMAIL PROTECTED]>
+
* exo-helper/helpers/sylpheed-claws.desktop.in.in: Apply patch from
Colin Leroy <[EMAIL PROTECTED]> to replace Sylpheed-Claws with Claws
Mail. Bug #2851.
Modified: libexo/trunk/configure.in.in
===================================================================
--- libexo/trunk/configure.in.in 2007-02-12 18:49:41 UTC (rev 24961)
+++ libexo/trunk/configure.in.in 2007-02-12 19:05:16 UTC (rev 24962)
@@ -108,14 +108,14 @@
locale.h math.h md5.h md5global.h mmintrin.h mntent.h \
paths.h regex.h signal.h stdarg.h string.h sys/mman.h \
sys/mnttab.h sys/mount.h sys/param.h sys/resource.h \
- sys/stat.h sys/time.h sys/types.h sys/ucred.h \
+ sys/statvfs.h sys/stat.h sys/time.h sys/types.h sys/ucred.h \
sys/wait.h time.h])
dnl ************************************
dnl *** Check for standard functions ***
dnl ************************************
AC_FUNC_MMAP()
-AC_CHECK_FUNCS([getfsstat getmntent regexec setfsent setmntent])
+AC_CHECK_FUNCS([getfsstat getmntent getvfsstat regexec setfsent setmntent])
dnl ******************************************
dnl *** Check for Message Digest functions ***
Modified: libexo/trunk/exo/exo-mount-point.c
===================================================================
--- libexo/trunk/exo/exo-mount-point.c 2007-02-12 18:49:41 UTC (rev 24961)
+++ libexo/trunk/exo/exo-mount-point.c 2007-02-12 19:05:16 UTC (rev 24962)
@@ -28,6 +28,9 @@
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
+#ifdef HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
@@ -250,7 +253,7 @@
/* close the file handle */
fclose (fp);
-#elif defined(HAVE_GETFSSTAT) /* BSD */
+#elif defined(HAVE_GETFSSTAT) /* FreeBSD, OpenBSD, DragonFly, older NetBSD */
struct statfs *mntbuf = NULL;
glong bufsize = 0;
gint mntsize;
@@ -276,6 +279,36 @@
/* release the buffer */
free (mntbuf);
}
+#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 = getvfsstat (NULL, 0, MNT_NOWAIT);
+ if (G_LIKELY (mntsize > 0))
+ {
+ /* allocate a new buffer */
+ bufsize = (mntsize + 4) * sizeof (*mntbuf);
+ mntbuf = (struct statvfs *) malloc (bufsize);
+
+ /* determine the mount point for the device file */
+ 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_flag & MNT_RDONLY) !=
0),
+ &mount_points);
+ }
+
+ /* release the buffer */
+ free (mntbuf);
+ }
#else
#error "Add support for your operating system here."
#endif
_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits