From db4023001c940ebf6884f6e554bd79364df5fc6c Mon Sep 17 00:00:00 2001 From: bescoto Date: Sun, 11 Jan 2004 07:51:22 +0000 Subject: 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 --- rdiff-backup/rdiff_backup/cmodule.c | 33 ++++++++++++++++++++++++++++----- 1 file 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 #include #include #include #include + +/* 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 +#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 -- cgit v1.2.1