--- shortcuts/src/applet-disk-usage.c.orig 2009-09-27 19:14:51.000000000 +0300 +++ shortcuts/src/applet-disk-usage.c 2010-02-03 22:25:09.000000000 +0200 @@ -18,10 +18,18 @@ */ #include -#include #include -#include +#if defined(__FreeBSD__) +#ifdef HAVE_MNTENT_H #include +#endif +#include +#include +#include +#else +#include +#include +#endif #include @@ -178,18 +186,50 @@ void cd_shortcuts_get_fs_info (const gchar *cDiskURI, GString *sInfo) { const gchar *cMountPath = (strncmp (cDiskURI, "file://", 7) == 0 ? cDiskURI + 7 : cDiskURI); +#if defined(__FreeBSD__) + struct statfs *me; +// FILE *mtab; +#else struct mntent *me; FILE *mtab = setmntent ("/etc/mtab", "r"); +#endif char *search_path; int match; char *slash; +#if defined(__FreeBSD__) + int i; + int count = getfsstat(me, NULL, MNT_WAIT); +// int count = getfsstat(me, NULL, MNT_NOWAIT); + if (count>0) + { + for (i=0; if_mntonname && strcmp (me->f_mntonname, cMountPath) == 0) + { + g_string_append_printf (sInfo, "Mount point : %s\nFile system : %s\nDevice : %s\nMount options : %s", + me->f_mntonname, + me->f_mntfromname, + me->f_fstypename, + me->f_charspare); +// if (me->mnt_freq != 0) +// g_string_append_printf (sInfo, "\nBackup frequency : %d days", me->mnt_freq); + break ; + } + } + } + else + { + cd_warning ("error getfsstat..."); + return ; + } +#else if (mtab == NULL) { cd_warning ("couldn't open /etc/mtab"); return ; } - + gchar *cFsInfo = NULL; while ((me = getmntent (mtab)) != NULL) { @@ -205,6 +245,7 @@ break ; } } - + endmntent (mtab); +#endif }