]> git.wh0rd.org - dump.git/blobdiff - restore/restore.c
Made -Q option work on regular files.
[dump.git] / restore / restore.c
index f0118f26b01940dc901fee6a925b137232d05cad..3cc2badf9654143be991a5102c5f8ad599960ba6 100644 (file)
@@ -2,8 +2,8 @@
  *     Ported to Linux's Second Extended File System as part of the
  *     dump and restore backup suit
  *     Remy Card <card@Linux.EU.Org>, 1994-1997
- *     Stelian Pop <pop@noos.fr>, 1999-2000
- *     Stelian Pop <pop@noos.fr> - Alcôve <www.alcove.fr>, 2000
+ *     Stelian Pop <stelian@popies.net>, 1999-2000
+ *     Stelian Pop <stelian@popies.net> - Alcôve <www.alcove.com>, 2000-2002
  */
 
 /*
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: restore.c,v 1.19 2001/12/24 12:31:12 stelian Exp $";
+       "$Id: restore.c,v 1.24 2002/01/22 11:12:28 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -505,7 +505,7 @@ nodeupdates(char *name, dump_ino_t ino, int type)
                if (compare_ignore_not_found) break;
                fprintf(stderr, "%s: (inode %lu) not found on tape\n",
                        name, (unsigned long)ino);
-               compare_errors = 1;
+               do_compare_error;
                break;
 
        /*
@@ -637,7 +637,7 @@ compare_entry(struct entry *ep, int do_compare)
 {
        if ((ep->e_flags & (NEW|EXTRACT)) == 0) {
                badentry(ep, "unexpected file on tape");
-               compare_errors = 1;
+               do_compare_error;
        }
        if (do_compare) (void) comparefile(myname(ep));
        ep->e_flags &= ~(NEW|EXTRACT);
@@ -669,7 +669,7 @@ compareleaves(void)
                        if (ep == NULL)
                                panic("%d: bad first\n", first);
                        fprintf(stderr, "%s: not found on tape\n", myname(ep));
-                       compare_errors = 1;
+                       do_compare_error;
                        ep->e_flags &= ~(NEW|EXTRACT);
                        first = lowerbnd(first);
                }
@@ -683,14 +683,14 @@ compareleaves(void)
                if (first != curfile.ino) {
                        fprintf(stderr, "expected next file %ld, got %lu\n",
                                (long)first, (unsigned long)curfile.ino);
-                       compare_errors = 1;
+                       do_compare_error;
                        skipfile();
                        goto next;
                }
                ep = lookupino(curfile.ino);
                if (ep == NULL) {
                        panic("unknown file on tape\n");
-                       compare_errors = 1;
+                       do_compare_error;
                }
                compare_entry(ep, 1);
                for (ep = ep->e_links; ep != NULL; ep = ep->e_links) {
@@ -723,7 +723,7 @@ compareleaves(void)
                        panic("%d: bad first\n", first);
                fprintf(stderr, "%s: (inode %lu) not found on tape\n", 
                        myname(ep), (unsigned long)first);
-               compare_errors = 1;
+               do_compare_error;
                ep->e_flags &= ~(NEW|EXTRACT);
                first = lowerbnd(first);
        }
@@ -822,7 +822,7 @@ createleaves(char *symtabfile)
                        panic("%d: bad first\n", first);
                fprintf(stderr, "%s: (inode %lu) not found on tape\n", 
                        myname(ep), (unsigned long)first);
-               compare_errors = 1;
+               do_compare_error;
                ep->e_flags &= ~(NEW|EXTRACT);
                first = lowerbnd(first);
        }
@@ -845,7 +845,10 @@ createfiles(void)
 
        Vprintf(stdout, "Extract requested files\n");
        curfile.action = SKIP;
-       getvol((long)1);
+#ifdef USE_QFA
+       if (!tapeposflag)
+#endif
+               getvol((long)1);
        skipmaps();
        skipdirs();
        first = lowerbnd(ROOTINO);
@@ -867,9 +870,10 @@ createfiles(void)
                 */
                while (curfile.ino > last) {
                        curfile.action = SKIP;
-                       getvol((long)0);
+                       if (!pipein)
+                               getvol((long)0);
                        if (curfile.ino == maxino) {
-                               next = lowerbnd(next);
+                               next = lowerbnd(first);
                                while (next < curfile.ino) {
                                        ep = lookupino(next);
                                        if (ep == NULL)