summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2004-01-11 07:51:22 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2004-01-11 07:51:22 +0000
commitdb4023001c940ebf6884f6e554bd79364df5fc6c (patch)
tree3a1aa5941ff9c94b3475e4f430becd4a85d0c426
parent33ebc912eaf524abbb30952ab8a601502ed53674 (diff)
downloadrdiff-backup-db4023001c940ebf6884f6e554bd79364df5fc6c.tar.gz
Added major/minor code from devel version
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/branches/r0-12@502 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/rdiff_backup/cmodule.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/rdiff-backup/rdiff_backup/cmodule.c b/rdiff-backup/rdiff_backup/cmodule.c
index cd00521..670d5dc 100644
--- a/rdiff-backup/rdiff_backup/cmodule.c
+++ b/rdiff-backup/rdiff_backup/cmodule.c
@@ -1,24 +1,47 @@
/* ----------------------------------------------------------------------- *
*
- * Copyright 2002 Ben Escoto
+ * Copyright 2002 2003 Ben Escoto
*
* This file is part of rdiff-backup.
*
* rdiff-backup is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, Inc., 675 Mass Ave,
- * Cambridge MA 02139, USA; either version 2 of the License, or (at
- * your option) any later version; incorporated herein by reference.
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * rdiff-backup is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with rdiff-backup; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307 USA
*
* ----------------------------------------------------------------------- */
-
#include <Python.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
+
+/* Some of the following code to define major/minor taken from code by
+ * Jörg Schilling's star archiver.
+ */
+#if !defined(major) && (defined(sgi) || defined(__sgi) || defined(__SVR4)) && !defined(__CYGWIN32__)
+#include <sys/mkdev.h>
+#endif
+
+#ifndef major
+# define major(dev) (((dev) >> 8) & 0xFF)
+# define minor(dev) ((dev) & 0xFF)
+# define makedev(majo, mino) (((majo) << 8) | (mino))
+#endif
+/* End major/minor section */
+
/* choose the appropriate stat and fstat functions and return structs */
/* This code taken from Python's posixmodule.c */
#undef STAT