diff options
author | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2003-07-24 09:31:28 +0000 |
---|---|---|
committer | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2003-07-24 09:31:28 +0000 |
commit | 9795da5e57f4ee432cfbe6d11ca636ad477d25ae (patch) | |
tree | d21e7af45bfa56ee5b8cfbad34978da67a2fa8d3 /rdiff-backup/rdiff_backup/cmodule.c | |
parent | 44f51b0a76c40241e8a94f7e891d2a65f4ae0384 (diff) | |
download | rdiff-backup-9795da5e57f4ee432cfbe6d11ca636ad477d25ae.tar.gz |
Added fs_abilities.py to makedist script
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@363 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/cmodule.c')
-rw-r--r-- | rdiff-backup/rdiff_backup/cmodule.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/rdiff-backup/rdiff_backup/cmodule.c b/rdiff-backup/rdiff_backup/cmodule.c index 0ed9710..0df8763 100644 --- a/rdiff-backup/rdiff_backup/cmodule.c +++ b/rdiff-backup/rdiff_backup/cmodule.c @@ -27,6 +27,20 @@ #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 @@ -147,7 +161,7 @@ static PyObject *c_make_file_dict(self, args) PyObject *major_num = PyLong_FromLongLong(major(devnums)); #else long int devnums = (long)sbuf.st_dev; - PyObject *major_num = PyInt_FromLong(devnums >> 8); + PyObject *major_num = PyInt_FromLong(major(devnums)); #endif int minor_num = (int)(minor(devnums)); if S_ISCHR(mode) strcpy(devtype, "c"); |