gvfs r2252 - in branches/gnome-2-24: . client



Author: hansp
Date: Thu Feb 26 14:55:01 2009
New Revision: 2252
URL: http://svn.gnome.org/viewvc/gvfs?rev=2252&view=rev

Log:
2009-02-26  Hans Petter Jansson  <hpj novell com>

	* client/gvfsfusedaemon.c (vfs_ftruncate): Immediately close the stream
	we get from g_file_replace(), so truncation becomes visible. Fixes
	BRC #479199.



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

Modified: branches/gnome-2-24/client/gvfsfusedaemon.c
==============================================================================
--- branches/gnome-2-24/client/gvfsfusedaemon.c	(original)
+++ branches/gnome-2-24/client/gvfsfusedaemon.c	Thu Feb 26 14:55:01 2009
@@ -1762,6 +1762,16 @@
                   fh->stream = NULL;
 
                   fh->stream = g_file_replace (file, 0, FALSE, 0, NULL, &error);
+
+                  if (fh->stream != NULL)
+                    {
+                      /* The stream created by g_file_replace() won't always replace
+                       * the file until it's been closed. So close it now to make
+                       * future operations consistent. */
+                      g_output_stream_close (fh->stream, NULL, NULL);
+                      g_object_unref (fh->stream);
+                      fh->stream = NULL;
+                    }
                 }
               else
                 {



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