--- libnautilus-extensions/nautilus-volume-monitor.c.orig Thu Oct 19 16:51:16 2000 +++ libnautilus-extensions/nautilus-volume-monitor.c Fri Jan 12 11:05:57 2001 @@ -60,4 +60,9 @@ #else +#ifdef __FreeBSD__ +#include +#include +#else #include #endif +#endif @@ -935,2 +940,40 @@ +#ifdef __FreeBSD__ +static void +fstab_add_mount_volume (NautilusVolumeMonitor *monitor, struct fstab *ent) +{ + NautilusVolume *volume; + gboolean mounted; + + volume = g_new0 (NautilusVolume, 1); + volume->fsname = g_strdup(ent->fs_spec); + volume->mount_path = g_strdup(ent->fs_file); + + mounted = FALSE; + + if (nautilus_str_has_prefix (ent->fs_spec, "/dev/fd")) { + mounted = mount_volume_floppy_add (monitor, volume); + } else if (strcmp (ent->fs_vfstype, "ufs") == 0) { + mounted = mount_volume_ext2_add (volume); + } else if (strcmp (ent->fs_vfstype, "nfs") == 0) { + mounted = mount_volume_nfs_add (volume); + } else if (strcmp (ent->fs_vfstype, "cd9660") == 0) { + mounted = mount_volume_iso9660_add (volume); + } else if (strcmp (ent->fs_vfstype, "msdos") == 0) { + mounted = mount_volume_msdos_add (volume); + } + + if (mounted) { + volume->is_read_only = strstr (ent->fs_type, FSTAB_RO) != NULL; + monitor->details->volumes = g_list_append (monitor->details->volumes, volume); + mount_volume_add_aliases (monitor, volume->fsname, volume); + } else { + g_free (volume->fsname); + g_free (volume->mount_path); + g_free (volume); + } +} + +#else + static void @@ -946,3 +989,3 @@ mounted = FALSE; - + if (nautilus_str_has_prefix (ent->mnt_fsname, FLOPPY_DEVICE_PATH_PREFIX)) { @@ -993,2 +1036,3 @@ } +#endif /* __FreeBSD__ */ #endif /* HAVE_SYS_MNTTAB_H */ @@ -1021,2 +1065,11 @@ { +#ifdef __FreeBSD__ + struct fstab *ent; + + setfsent (); + while ((ent = getfsent ())) + fstab_add_mount_volume (monitor, ent); + endfsent (); +#else + FILE *mef; @@ -1055,2 +1108,4 @@ #endif + +#endif /* __FreeBSD__ */