]> git.wh0rd.org - dump.git/blobdiff - dump/main.c
Check for the e2fsprogs header <ext2fs/ext2_fs.h> instead of the kernel header if...
[dump.git] / dump / main.c
index d3ebc8285a73dc58ce9c2519a4be01dd6f8e9fdf..ae9ffce26135fd350911ae73eb4a350385137e14 100644 (file)
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: main.c,v 1.45 2001/04/12 16:03:29 stelian Exp $";
+       "$Id: main.c,v 1.49 2001/06/18 10:58:28 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
+#include <compatlfs.h>
 #include <ctype.h>
 #include <compaterr.h>
 #include <fcntl.h>
@@ -58,7 +59,11 @@ static const char rcsid[] =
 #include <sys/param.h>
 #include <sys/time.h>
 #ifdef __linux__
+#ifdef HAVE_EXT2FS_EXT2_FS_H
+#include <ext2fs/ext2_fs.h>
+#else
 #include <linux/ext2_fs.h>
+#endif
 #include <ext2fs/ext2fs.h>
 #include <time.h>
 #include <sys/stat.h>
@@ -91,7 +96,7 @@ int   ntrec = NTREC;  /* # tape blocks in each tape record */
 int    cartridge = 0;  /* Assume non-cartridge tape */
 #ifdef USE_QFA
 int    tapepos = 0;    /* assume no QFA tapeposition needed by user */
-#endif /* USA_QFA */
+#endif /* USE_QFA */
 int    dokerberos = 0; /* Use Kerberos authentication */
 long   dev_bsize = 1;  /* recalculated below */
 long   blocksperfile;  /* output blocks per file */
@@ -124,7 +129,7 @@ main(int argc, char *argv[])
        register int ch;
        int i, anydirskipped, bflag = 0, Tflag = 0, honorlevel = 1;
        dump_ino_t maxino;
-       struct stat statbuf;
+       struct STAT statbuf;
        dev_t filedev = 0;
 #ifdef __linux__
        errcode_t retval;
@@ -160,7 +165,7 @@ main(int argc, char *argv[])
 
 #ifdef USE_QFA
        gTapeposfd = -1;
-#endif /* USA_QFA */
+#endif /* USE_QFA */
 
        while ((ch = getopt(argc, argv,
                            "0123456789aB:b:cd:e:f:F:h:L:"
@@ -282,7 +287,7 @@ main(int argc, char *argv[])
                        gTapeposfile = optarg;
                        tapepos = 1;
                        break;
-#endif /* USA_QFA */
+#endif /* USE_QFA */
                        
                case 's':               /* tape size, feet */
                        unlimited = 0;
@@ -543,7 +548,7 @@ main(int argc, char *argv[])
                msg("The ENTIRE dump is aborted.\n");
                exit(X_STARTUP);
        }
-       if ((diskfd = open(disk, O_RDONLY)) < 0) {
+       if ((diskfd = OPEN(disk, O_RDONLY)) < 0) {
                msg("Cannot open %s\n", disk);
                msg("The ENTIRE dump is aborted.\n");
                exit(X_STARTUP);
@@ -604,10 +609,13 @@ main(int argc, char *argv[])
 
        nonodump = spcl.c_level < honorlevel;
 
-       msg("Label: %s\n", spcl.c_label);
+       if (!sizest) {
+               msg("Label: %s\n", spcl.c_label);
 
-       if (compressed)
-               msg("Compressing output at compression level %d\n", compressed);
+               if (compressed)
+                       msg("Compressing output at compression level %d\n", 
+                           compressed);
+       }
 
 #if defined(SIGINFO)
        (void)signal(SIGINFO, statussig);
@@ -619,7 +627,7 @@ main(int argc, char *argv[])
        if (directory[0] == 0)
                anydirskipped = mapfiles(maxino, &tapesize);
        else {
-               if (stat(pathname, &statbuf) == -1) {
+               if (STAT(pathname, &statbuf) == -1) {
                        msg("File cannot be accessed (%s).\n", pathname);
                        msg("The ENTIRE dump is aborted.\n");
                        exit(X_STARTUP);
@@ -636,7 +644,7 @@ main(int argc, char *argv[])
                int anydirskipped2;
                char *p = *argv;
                /* check if file is available */
-               if (stat(p, &statbuf) == -1) {
+               if (STAT(p, &statbuf) == -1) {
                        msg("File cannot be accessed (%s).\n", p);
                        msg("The ENTIRE dump is aborted.\n");
                        exit(X_STARTUP);