diff -Nur gnome-vfs2-2.18.0.1/libgnomevfs/gnome-vfs-unix-mounts.c gnome-vfs2-2.18.0.1.new/libgnomevfs/gnome-vfs-unix-mounts.c --- gnome-vfs2-2.18.0.1/libgnomevfs/gnome-vfs-unix-mounts.c 2007-03-18 10:54:52.000000000 +0100 +++ gnome-vfs2-2.18.0.1.new/libgnomevfs/gnome-vfs-unix-mounts.c 2007-03-18 10:57:10.000000000 +0100 @@ -40,6 +40,10 @@ #ifdef HAVE_POLL_H #include #endif +/* for realpath */ +#include +#include + #include #include #include @@ -273,6 +277,16 @@ mounts_hash = g_hash_table_new (g_str_hash, g_str_equal); while ((mntent = getmntent (file)) != NULL) { + char rpath[PATH_MAX]; + char *device_path; + + if (realpath (mntent->mnt_fsname, rpath)) { + device_path = g_strdup (rpath); + } + else { + device_path = g_strdup (mntent->mnt_fsname); + } + /* ignore any mnt_fsname that is repeated and begins with a '/' * * We do this to avoid being fooled by --bind mounts, since @@ -283,25 +297,16 @@ * * The '/' is to handle procfs, tmpfs and other no device mounts. */ - if (mntent->mnt_fsname != NULL && - mntent->mnt_fsname[0] == '/' && - g_hash_table_lookup (mounts_hash, mntent->mnt_fsname)) { + if (device_path[0] == '/' && + g_hash_table_lookup (mounts_hash, device_path)) { + g_free(device_path); continue; } mount_entry = g_new0 (GnomeVFSUnixMount, 1); mount_entry->mount_path = g_strdup (mntent->mnt_dir); - mount_entry->device_path = g_strdup (mntent->mnt_fsname); - - if (g_file_test (mntent->mnt_fsname, G_FILE_TEST_IS_SYMLINK)) { - char rpath[PATH_MAX]; - if (realpath (mntent->mnt_fsname, rpath)) { - g_free (mount_entry->device_path); - mount_entry->device_path = g_strdup (rpath); - } - } - + mount_entry->device_path = device_path; mount_entry->filesystem_type = g_strdup (mntent->mnt_type); g_hash_table_insert (mounts_hash,