libgsf r1003 - in trunk: . gsf
- From: mortenw svn gnome org
- To: svn-commits-list gnome org
- Subject: libgsf r1003 - in trunk: . gsf
- Date: Wed, 3 Sep 2008 23:15:44 +0000 (UTC)
Author: mortenw
Date: Wed Sep 3 23:15:44 2008
New Revision: 1003
URL: http://svn.gnome.org/viewvc/libgsf?rev=1003&view=rev
Log:
2008-09-03 Morten Welinder <terra gnome org>
* gsf/gsf-output-stdio.c (rename_wrapper): Work around sshfs
brokenness. Fixes #509883.
Modified:
trunk/ChangeLog
trunk/NEWS
trunk/configure.in
trunk/gsf/gsf-output-stdio.c
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Wed Sep 3 23:15:44 2008
@@ -1,3 +1,9 @@
+libgsf 1.14.10
+
+Morten:
+ * Work around sshfs bug. [#509883]
+
+--------------------------------------------------------------------------
libgsf 1.14.9
Dom:
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Wed Sep 3 23:15:44 2008
@@ -161,7 +161,7 @@
fi
AC_TYPE_MODE_T
-AC_CHECK_HEADERS(fcntl.h malloc.h unistd.h io.h)
+AC_CHECK_HEADERS(fcntl.h malloc.h unistd.h io.h sys/statfs.h)
AC_FUNC_MMAP
AC_CHECK_FUNCS(chown setrlimit)
Modified: trunk/gsf/gsf-output-stdio.c
==============================================================================
--- trunk/gsf/gsf-output-stdio.c (original)
+++ trunk/gsf/gsf-output-stdio.c Wed Sep 3 23:15:44 2008
@@ -34,6 +34,9 @@
#endif
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
#ifdef G_OS_WIN32
#include <wchar.h>
@@ -67,14 +70,33 @@
rename_wrapper (char const *oldfilename, char const *newfilename)
{
int result = g_rename (oldfilename, newfilename);
-#ifdef G_OS_WIN32
- if (result) {
- /* Win32's rename does not unlink the target. */
- (void)g_unlink (newfilename);
- result = g_rename (oldfilename, newfilename);
+ if (!result)
+ goto done;
+
+#ifdef HAVE_SYS_STATFS_H
+ /* The FUSE file system does not unlink the target. */
+ if (errno == EPERM) {
+ int save_errno = errno;
+ struct statfs buf;
+ if (statfs (newfilename, &buf) == 0 &&
+ memcmp (&buf.f_type, "FUse", 4) == 0)
+ goto unlink_and_retry;
+ errno = save_errno;
}
#endif
+
+#ifdef G_OS_WIN32
+ /* Win32's rename does not unlink the target. */
+ goto unlink_and_retry;
+#endif
+
+done:
return result;
+
+unlink_and_retry:
+ (void)g_unlink (newfilename);
+ result = g_rename (oldfilename, newfilename);
+ goto done;
}
static int
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]