gnome-vfs r5507 - in trunk: . libgnomevfs



Author: tml
Date: Fri Sep 12 00:31:54 2008
New Revision: 5507
URL: http://svn.gnome.org/viewvc/gnome-vfs?rev=5507&view=rev

Log:
2008-09-12  Tor Lillqvist  <tml novell com>

	* libgnomevfs/gnome-vfs-open-fd.c (do_truncate_handle): On
	Windows, instead of ftruncate use _chsize(). It doesn't handle
	64-bit sizes, though, so fail in case a "large" length is passed
	to us.



Modified:
   trunk/ChangeLog
   trunk/libgnomevfs/gnome-vfs-open-fd.c

Modified: trunk/libgnomevfs/gnome-vfs-open-fd.c
==============================================================================
--- trunk/libgnomevfs/gnome-vfs-open-fd.c	(original)
+++ trunk/libgnomevfs/gnome-vfs-open-fd.c	Fri Sep 12 00:31:54 2008
@@ -37,6 +37,11 @@
 #include "gnome-vfs-handle-private.h"
 #include "gnome-vfs-utils.h"
 
+#ifdef G_OS_WIN32
+#include <errno.h>
+#define ftruncate(fd,length) ((length < G_MAXLONG) ? _chsize (fd, length) : (errno = EINVAL, -1))
+#endif
+
 static GnomeVFSURI*
 create_anonymous_uri (GnomeVFSMethod* method)
 {



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