summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup/cmodule.c
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-08-03 18:13:52 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-08-03 18:13:52 +0000
commite8e42b297242a63d7b1f4d128eaf7571c4e9d06c (patch)
treeb8fa21e5d34615878737ea08c52aa17eef98fde0 /rdiff-backup/rdiff_backup/cmodule.c
parent6caeb6564ff4bae632bbbcf5348c55996776289e (diff)
downloadrdiff-backup-e8e42b297242a63d7b1f4d128eaf7571c4e9d06c.tar.gz
Fixes for --calculate-average, python 2.3, and mac os x
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@371 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/cmodule.c')
-rw-r--r--rdiff-backup/rdiff_backup/cmodule.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/rdiff-backup/rdiff_backup/cmodule.c b/rdiff-backup/rdiff_backup/cmodule.c
index 0df8763..30aac47 100644
--- a/rdiff-backup/rdiff_backup/cmodule.c
+++ b/rdiff-backup/rdiff_backup/cmodule.c
@@ -57,13 +57,23 @@
#define PY_LONG_LONG LONG_LONG
#endif
+/* The following section is by Jeffrey A. Marshall and compensates for
+ * a bug in Mac OS X's S_ISFIFO and S_ISSOCK macros.
+ */
+#ifdef __APPLE__
+/* S_ISFIFO/S_ISSOCK macros from <sys/stat.h> on mac osx are bogus */
+#undef S_ISSOCK /* their definition of a socket includes fifos */
+#undef S_ISFIFO /* their definition of a fifo includes sockets */
+#define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK)
+#define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO)
+#endif
+
static PyObject *UnknownFileTypeError;
static PyObject *c_make_file_dict(PyObject *self, PyObject *args);
static PyObject *long2str(PyObject *self, PyObject *args);
static PyObject *str2long(PyObject *self, PyObject *args);
static PyObject *my_sync(PyObject *self, PyObject *args);
-
/* Turn a stat structure into a python dictionary. The preprocessor
stuff taken from Python's posixmodule.c */
static PyObject *c_make_file_dict(self, args)