Bugzilla – Attachment 47665 Details for
Bug 113005
nautilus 'My Computer': confused ...
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
Proposed fix!
gnome-vfs-double-drives-bug-fix-rml-1.patch (text/plain), 3.29 KB, created by
Robert Love
on 2005-08-25 20:33:30 UTC
(
hide
)
Description:
Proposed fix!
Filename:
MIME Type:
Creator:
Robert Love
Created:
2005-08-25 20:33:30 UTC
Size:
3.29 KB
patch
obsolete
>? compile >? imported/fnmatch/Makefile.in >Index: libgnomevfs/gnome-vfs-hal-mounts.c >=================================================================== >RCS file: /cvs/gnome/gnome-vfs/libgnomevfs/gnome-vfs-hal-mounts.c,v >retrieving revision 1.17 >diff -u -r1.17 gnome-vfs-hal-mounts.c >--- libgnomevfs/gnome-vfs-hal-mounts.c 24 Aug 2005 04:40:04 -0000 1.17 >+++ libgnomevfs/gnome-vfs-hal-mounts.c 25 Aug 2005 20:32:51 -0000 >@@ -32,6 +32,7 @@ > #include <sys/sysmacros.h> > #include <sys/types.h> > #include <unistd.h> >+#include <limits.h> > > #include <glib.h> > #include <glib/gi18n-lib.h> >@@ -49,6 +50,10 @@ > > #define PATH_GCONF_GNOME_VFS_STORAGE "/system/storage" > >+#ifndef PATHNAME_MAX >+# define PATHNAME_MAX 1024 >+#endif >+ > typedef struct { > GnomeVFSVolumeMonitorDaemon *volume_monitor_daemon; > gboolean display_internal_hard_drives; >@@ -1425,6 +1430,9 @@ > GnomeVFSDrive *result; > LibHalContext *hal_ctx; > LibHalDrive *hal_drive; >+ char path[PATH_MAX] = "/dev/"; >+ char *target = path + 5; >+ int ret; > > hal_drive = NULL; > >@@ -1445,6 +1453,22 @@ > /* ok, this device file is in HAL and thus managed by this backend */ > gnome_vfs_drive_unref (drive); > result = NULL; >+ goto out; >+ } >+ >+ /* No luck? Let's see if device_path is a symlink and check its target, too */ >+ ret = readlink (drive->priv->device_path, target, PATH_MAX - 1); >+ if (ret < 0) >+ goto out; >+ target[ret] = '\0'; >+ /* Save some prepending and store the "/dev/" needed for relative links */ >+ if (target[0] != '/') >+ target = path; >+ hal_drive = libhal_drive_from_device_file (hal_ctx, target); >+ if (hal_drive != NULL) { >+ /* ok, this device file is in HAL and thus managed by this backend */ >+ gnome_vfs_drive_unref (drive); >+ result = NULL; > } > > out: >@@ -1460,6 +1484,9 @@ > GnomeVFSVolume *result; > LibHalContext *hal_ctx; > LibHalDrive *hal_drive; >+ char path[PATH_MAX] = "/dev/"; >+ char *target = path + 5; >+ int ret; > > hal_drive = NULL; > >@@ -1478,6 +1505,39 @@ > hal_drive = libhal_drive_from_device_file (hal_ctx, volume->priv->device_path); > if (hal_drive != NULL) { > >+ /* handle drives that HAL can't poll and the user can still mount */ >+ if (libhal_device_get_property_bool (hal_ctx, >+ libhal_drive_get_udi (hal_drive), >+ "storage.media_check_enabled", >+ NULL) == FALSE) { >+ GnomeVFSDrive *drive; >+ >+ if ((drive = _gnome_vfs_volume_monitor_find_drive_by_hal_udi ( >+ GNOME_VFS_VOLUME_MONITOR (volume_monitor_daemon), >+ libhal_drive_get_udi (hal_drive))) != NULL) { >+ volume->priv->drive = drive; >+ _gnome_vfs_drive_add_mounted_volume (drive, volume); >+ >+ goto out; >+ } >+ } >+ >+ /* ok, this device file is in HAL and thus managed by this backend */ >+ gnome_vfs_volume_unref (volume); >+ result = NULL; >+ goto out; >+ } >+ >+ /* No luck? Let's see if device_path is a symlink and check its target, too */ >+ ret = readlink (volume->priv->device_path, target, PATH_MAX - 1); >+ if (ret < 0) >+ goto out; >+ target[ret] = '\0'; >+ /* Save some prepending and store the "/dev/" needed for relative links */ >+ if (target[0] != '/') >+ target = path; >+ hal_drive = libhal_drive_from_device_file (hal_ctx, target); >+ if (hal_drive != NULL) { > /* handle drives that HAL can't poll and the user can still mount */ > if (libhal_device_get_property_bool (hal_ctx, > libhal_drive_get_udi (hal_drive),
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 113005
:
47569
|
47570
| 47665