Re: Question about TnyVfsStream



On Sat, Mar 15, 2008 at 02:08:28PM +0100, Philip Van Hoof wrote:

[ Question about tny_vfs_reset() ]
> > Here, priv->position is never modified, not even if gnome_vfs_seek()
> > returns GNOME_VFS_OK, that's why it looks wrong (I don't have any bug
> > caused by this BTW, I just noticed it when I was debugging another
> > thing).
> Ok, patches are welcome 

Attached here, sorry for the delay :)

-- 
Alberto García González
http://people.igalia.com/berto/
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 3520)
+++ ChangeLog	(working copy)
@@ -1,3 +1,8 @@
+2008-03-25  Alberto Garcia Gonzalez <agarcia igalia com>
+
+	* libtinymail-gnomevfs/tny-vfs-stream.c:
+	(tny_vfs_reset): Set priv->position to 0 after a successful reset
+
 2008-03-25  Philip Van Hoof <pvanhoof gnome org>
 
 	* Replaced a GByteArray with a EByteArray
Index: libtinymail-gnomevfs/tny-vfs-stream.c
===================================================================
--- libtinymail-gnomevfs/tny-vfs-stream.c	(revision 3520)
+++ libtinymail-gnomevfs/tny-vfs-stream.c	(working copy)
@@ -333,8 +333,9 @@
 
 	res = gnome_vfs_seek (priv->handle, GNOME_VFS_SEEK_START, 0);
 
-	if (res != GNOME_VFS_OK)
-	{
+	if (res == GNOME_VFS_OK) {
+		priv->position = 0;
+	} else {
 		tny_vfs_stream_set_errno (res);
 		retval = -1;
 	}


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