rdiff-backup-commits
[Top][All Lists]
Advanced

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

[Rdiff-backup-commits] rdiff-backup CHANGELOG rdiff_backup/cmodule.c


From: Andrew Ferguson
Subject: [Rdiff-backup-commits] rdiff-backup CHANGELOG rdiff_backup/cmodule.c
Date: Tue, 08 Apr 2008 13:06:55 +0000

CVSROOT:        /sources/rdiff-backup
Module name:    rdiff-backup
Changes by:     Andrew Ferguson <owsla> 08/04/08 13:06:55

Modified files:
        .              : CHANGELOG 
        rdiff_backup   : cmodule.c 

Log message:
        Get cmodule.c building natively on Windows (Patch from Josh Nisly)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/rdiff-backup/CHANGELOG?cvsroot=rdiff-backup&r1=1.263&r2=1.264
http://cvs.savannah.gnu.org/viewcvs/rdiff-backup/rdiff_backup/cmodule.c?cvsroot=rdiff-backup&r1=1.22&r2=1.23

Patches:
Index: CHANGELOG
===================================================================
RCS file: /sources/rdiff-backup/rdiff-backup/CHANGELOG,v
retrieving revision 1.263
retrieving revision 1.264
diff -u -b -r1.263 -r1.264
--- CHANGELOG   28 Jan 2008 04:33:55 -0000      1.263
+++ CHANGELOG   8 Apr 2008 13:06:55 -0000       1.264
@@ -1,6 +1,8 @@
 New in v1.1.16 (????/??/??)
 ---------------------------
 
+Get cmodule.c building natively on Windows. (Patch from Josh Nisly)
+
 Don't give up right away if we can't open a file. Try chmod'ing it even
 if we aren't root or don't own it, since that can sometimes work on AFS
 and NFS. Closes Savannah bug #21202. (Andrew Ferguson)

Index: rdiff_backup/cmodule.c
===================================================================
RCS file: /sources/rdiff-backup/rdiff-backup/rdiff_backup/cmodule.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- rdiff_backup/cmodule.c      7 Sep 2005 17:33:25 -0000       1.22
+++ rdiff_backup/cmodule.c      8 Apr 2008 13:06:55 -0000       1.23
@@ -24,7 +24,9 @@
 #include <Python.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#if !defined(MS_WIN64) && !defined(MS_WIN32)
 #include <unistd.h>
+#endif
 #include <errno.h>
 
 
@@ -46,13 +48,17 @@
 /* This code taken from Python's posixmodule.c */
 #undef STAT
 #if defined(MS_WIN64) || defined(MS_WIN32)
+#      define LSTAT _stati64
 #      define STAT _stati64
 #      define FSTAT _fstati64
 #      define STRUCT_STAT struct _stati64
+#      define SYNC _flushall
 #else
+#      define LSTAT lstat
 #      define STAT stat
 #      define FSTAT fstat
 #      define STRUCT_STAT struct stat
+#      define SYNC sync
 #endif
 #ifndef PY_LONG_LONG 
     #define PY_LONG_LONG LONG_LONG 
@@ -69,6 +75,15 @@
 #define S_ISFIFO(mode)        (((mode) & S_IFMT) == S_IFIFO)
 #endif
 
+#if defined(MS_WIN64) || defined(MS_WIN32)
+#define S_ISSOCK(mode) (0)
+#define S_ISFIFO(mode) (0)
+#define S_ISLNK(mode) (0)
+#define S_ISLNK(mode) (0)
+#define S_ISCHR(mode) (0)
+#define S_ISBLK(mode) (0)
+#endif
+
 static PyObject *UnknownFileTypeError;
 static PyObject *c_make_file_dict(PyObject *self, PyObject *args);
 static PyObject *long2str(PyObject *self, PyObject *args);
@@ -90,7 +105,7 @@
   if (!PyArg_ParseTuple(args, "s", &filename)) return NULL;
 
   Py_BEGIN_ALLOW_THREADS
-  res = lstat(filename, &sbuf);
+  res = LSTAT(filename, &sbuf);
   Py_END_ALLOW_THREADS
 
   if (res != 0) {
@@ -225,7 +240,7 @@
         PyObject *args;
 {
   if (!PyArg_ParseTuple(args, "")) return NULL;
-  sync();
+  SYNC();
   return Py_BuildValue("");
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]