summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup/cmodule.c
diff options
context:
space:
mode:
authorowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-06-10 12:55:59 +0000
committerowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-06-10 12:55:59 +0000
commitfce09cb7e56fa39daaecce4ee320fffe2960d162 (patch)
tree5e9f7b94dc1cbe9bb03433cc3a1ac8ff74d23b72 /rdiff-backup/rdiff_backup/cmodule.c
parent78436fc6a88a0d5c6d8bddc884b8a8814ac4466c (diff)
downloadrdiff-backup-fce09cb7e56fa39daaecce4ee320fffe2960d162.tar.gz
Do not use inode numbers on Windows and gracefully handle attempts to
rename over existing files on Windows. (Patch from Josh Nisly) git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@886 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/cmodule.c')
-rw-r--r--rdiff-backup/rdiff_backup/cmodule.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/rdiff-backup/rdiff_backup/cmodule.c b/rdiff-backup/rdiff_backup/cmodule.c
index 28c5292..36915a6 100644
--- a/rdiff-backup/rdiff_backup/cmodule.c
+++ b/rdiff-backup/rdiff_backup/cmodule.c
@@ -66,6 +66,8 @@
/* The following section is by Jeffrey A. Marshall and compensates for
* a bug in Mac OS X's S_ISFIFO and S_ISSOCK macros.
+ * Note: Starting in Mac OS X 10.3, the buggy macros were changed to be
+ * the same as the ones below.
*/
#ifdef __APPLE__
/* S_ISFIFO/S_ISSOCK macros from <sys/stat.h> on mac osx are bogus */
@@ -116,13 +118,18 @@ static PyObject *c_make_file_dict(self, args)
return NULL;
}
}
+#if defined(MS_WINDOWS)
+ size = PyLong_FromLongLong((PY_LONG_LONG)sbuf.st_size);
+ inode = PyLong_FromLongLong((PY_LONG_LONG)-1);
+#else
#ifdef HAVE_LARGEFILE_SUPPORT
size = PyLong_FromLongLong((PY_LONG_LONG)sbuf.st_size);
inode = PyLong_FromLongLong((PY_LONG_LONG)sbuf.st_ino);
#else
size = PyInt_FromLong(sbuf.st_size);
inode = PyInt_FromLong((long)sbuf.st_ino);
-#endif
+#endif /* HAVE_LARGEFILE_SUPPORT */
+#endif /* defined(MS_WINDOWS) */
mode = (long)sbuf.st_mode;
perms = mode & 07777;
#if defined(HAVE_LONG_LONG) && !defined(MS_WINDOWS)