[PATCH] gnome-vfs: Don't monitor read-only filesystems



Here is a patch that stops gnome-vfs from monitoring a read-only
filesystem. This should stop the unmounting problems people have with
FAM. 

John
Index: libgnomevfs/gnome-vfs-monitor.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/libgnomevfs/gnome-vfs-monitor.c,v
retrieving revision 1.10
diff -u -r1.10 gnome-vfs-monitor.c
--- libgnomevfs/gnome-vfs-monitor.c	25 Mar 2003 13:21:53 -0000	1.10
+++ libgnomevfs/gnome-vfs-monitor.c	25 Jan 2004 18:25:30 -0000
@@ -94,9 +94,29 @@
 			  GnomeVFSMonitorCallback callback,
 			  gpointer user_data)
 {
+	GnomeVFSVolume *volume;
+	GnomeVFSVolumeMonitor *volume_monitor;
 	GnomeVFSResult result;
 	GnomeVFSMonitorHandle *monitor_handle = 
 		g_new0(GnomeVFSMonitorHandle, 1);
+
+	volume_monitor = gnome_vfs_get_volume_monitor ();
+	volume = gnome_vfs_volume_monitor_get_volume_for_path (volume_monitor, uri);
+	gnome_vfs_volume_monitor_unref (volume_monitor);
+
+	/* Don't monitor read-only filesystems */
+	if (TRUE == gnome_vfs_volume_is_read_only (volume))
+	{
+		gnome_vfs_volume_unref (volume);
+		gnome_vfs_uri_unref (uri);
+		g_free (monitor_handle);
+		monitor_handle = NULL;
+		*handle = monitor_handle;
+
+		return GNOME_VFS_ERROR_READ_ONLY_FILE_SYSTEM;
+	}
+
+	gnome_vfs_volume_unref (volume);
 
 	init_hash_table ();
 	gnome_vfs_uri_ref (uri);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]