gvfs r1821 - in branches/gnome-2-22: . client



Author: hansp
Date: Fri Jul 18 23:18:04 2008
New Revision: 1821
URL: http://svn.gnome.org/viewvc/gvfs?rev=1821&view=rev

Log:
2008-07-18  Hans Petter Jansson  <hpj novell com>

	* client/gvfsfusedaemon.c (vfs_open)
	(vfs_create): Hold the file handle lock while opening the stream.
	Second part of fix for #536614.



Modified:
   branches/gnome-2-22/ChangeLog
   branches/gnome-2-22/client/gvfsfusedaemon.c

Modified: branches/gnome-2-22/client/gvfsfusedaemon.c
==============================================================================
--- branches/gnome-2-22/client/gvfsfusedaemon.c	(original)
+++ branches/gnome-2-22/client/gvfsfusedaemon.c	Fri Jul 18 23:18:04 2008
@@ -961,11 +961,15 @@
 
               /* Set up a stream here, so we can check for errors */
 
+              g_mutex_lock (fh->mutex);
+
               if (fi->flags & O_WRONLY || fi->flags & O_RDWR)
                 result = setup_output_stream (file, fh);
               else
                 result = setup_input_stream (file, fh);
 
+              g_mutex_unlock (fh->mutex);
+
               /* The added reference to the file handle is released in vfs_release() */
             }
           else if (file_type == G_FILE_TYPE_DIRECTORY)
@@ -1049,11 +1053,14 @@
 
               SET_FILE_HANDLE (fi, fh);
 
-              g_assert (fh->stream == NULL);
+              g_mutex_lock (fh->mutex);
 
+              file_handle_close_stream (fh);
               fh->stream = file_output_stream;
               fh->op = FILE_OP_WRITE;
 
+              g_mutex_unlock (fh->mutex);
+
               /* The added reference to the file handle is released in vfs_release() */
             }
           else



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