X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=restore%2Fmain.c;h=fd002258af1aac06b90d532522ee1df429498f6a;hb=816bf0d9a643ed425d9677064d58b626d7df7b70;hp=344ec5cacf0567ea5561991e30dbc4473e033a9d;hpb=3d78f5f2dbe4f24a0c80f286e67ce79e9ef377c4;p=dump.git diff --git a/restore/main.c b/restore/main.c index 344ec5c..fd00225 100644 --- a/restore/main.c +++ b/restore/main.c @@ -2,7 +2,8 @@ * Ported to Linux's Second Extended File System as part of the * dump and restore backup suit * Remy Card , 1994-1997 - * Stelian Pop , 1999-2000 + * Stelian Pop , 1999-2000 + * Stelian Pop - AlcĂ´ve , 2000 */ /* @@ -40,15 +41,20 @@ #ifndef lint static const char rcsid[] = - "$Id: main.c,v 1.12 2000/05/28 16:52:21 stelian Exp $"; + "$Id: main.c,v 1.19 2001/03/23 14:40:12 stelian Exp $"; #endif /* not lint */ +#include #include #include #include #ifdef __linux__ +#ifdef HAVE_EXT2FS_EXT2_FS_H +#include +#else #include +#endif #include #include #include @@ -72,7 +78,7 @@ static const char rcsid[] = #include "extern.h" int bflag = 0, cvtflag = 0, dflag = 0, vflag = 0, yflag = 0; -int hflag = 1, mflag = 1, Nflag = 0; +int hflag = 1, mflag = 1, Nflag = 0, zflag = 0; int uflag = 0; int dokerberos = 0; char command = '\0'; @@ -81,7 +87,7 @@ long volno = 0; long ntrec; char *dumpmap; char *usedinomap; -ino_t maxino; +dump_ino_t maxino; time_t dumptime; time_t dumpdate; FILE *terminal; @@ -103,7 +109,7 @@ int main(int argc, char *argv[]) { int ch; - ino_t ino; + dump_ino_t ino; char *inputdev = _PATH_DEFTAPE; char *symtbl = "./restoresymtable"; char *p, name[MAXPATHLEN]; @@ -399,20 +405,29 @@ main(int argc, char *argv[]) static void usage(void) { +#ifdef __linux__ + const char *ext2ver, *ext2date; + + ext2fs_get_library_version(&ext2ver, &ext2date); + (void)fprintf(stderr, "%s %s (using libext2fs %s of %s)\n", + __progname, _DUMP_VERSION, ext2ver, ext2date); +#else + (void)fprintf(stderr, "%s %s\n", __progname, _DUMP_VERSION); +#endif + #ifdef KERBEROS #define kerbflag "k" #else #define kerbflag #endif - (void)fprintf(stderr, - "%s %s\n", __progname, _DUMP_VERSION); (void)fprintf(stderr, - "usage:\t%s%s\n\t%s%s\n\t%s%s\n\t%s%s\n\t%s%s\n", + "usage:\t%s%s\n\t%s%s\n\t%s%s\n\t%s%s\n\t%s%s\n\t%s%s\n", + __progname, " -C [-c" kerbflag "Mvy] [-b blocksize] [-D filesystem] [-f file] [-s fileno]", __progname, " -i [-ch" kerbflag "mMuvy] [-b blocksize] [-f file] [-s fileno]", - __progname, " -r [-c" kerbflag "Muvy] [-b blocksize] [-f file] [-s fileno]", - __progname, " -R [-c" kerbflag "Muvy] [-b blocksize] [-f file] [-s fileno]", - __progname, " -x [-ch" kerbflag "mMuvy] [-b blocksize] [-f file] [-s fileno] [-X filelist] [file ...]", - __progname, " -t [-ch" kerbflag "Muvy] [-b blocksize] [-f file] [-s fileno] [-X filelist] [file ...]"); + __progname, " -r [-c" kerbflag "Muvy] [-b blocksize] [-f file] [-s fileno] [-T directory]", + __progname, " -R [-c" kerbflag "Muvy] [-b blocksize] [-f file] [-s fileno] [-T directory]", + __progname, " -t [-ch" kerbflag "Muvy] [-b blocksize] [-f file] [-s fileno] [-X filelist] [file ...]", + __progname, " -x [-ch" kerbflag "mMuvy] [-b blocksize] [-f file] [-s fileno] [-X filelist] [file ...]"); exit(1); }