]> git.wh0rd.org - dump.git/commitdiff
Fixed restore to correctly access the archive file (-A argument) even when using...
authorStelian Pop <stelian@popies.net>
Tue, 11 Feb 2003 12:43:44 +0000 (12:43 +0000)
committerStelian Pop <stelian@popies.net>
Tue, 11 Feb 2003 12:43:44 +0000 (12:43 +0000)
Corrected Gunther Reiszig's contact information.

CHANGES
THANKS
restore/tape.c

diff --git a/CHANGES b/CHANGES
index dee04080fb6181af6fe865cdef67d5e21a63a9bc..e3b00042622eb0c7cde9546094181ad7cf844746 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.214 2003/02/11 09:56:46 stelian Exp $
+$Id: CHANGES,v 1.215 2003/02/11 12:43:44 stelian Exp $
 
 Changes between versions 0.4b33 and 0.4b34 (released ?????????????????)
 =======================================================================
@@ -14,7 +14,11 @@ Changes between versions 0.4b33 and 0.4b34 (released ?????????????????)
 
 3.     Fixed restore to correctly ignore sockets when comparing
        a dump (as socket cannot be properly restored anyway). Thanks
-       to <gunther@mit.edu> for reporting the bug.
+       to Gunther Reiszig <gunther@mit.edu> for reporting the bug.
+
+4.     Fixed restore to correctly access the archive file (-A argument)
+       even when using a remote tape. Thanks to Fabrice Bellet 
+       <fabrice@bellet.info> for reporting the bug.
 
 Changes between versions 0.4b32 and 0.4b33 (released February 10, 2003)
 =======================================================================
diff --git a/THANKS b/THANKS
index f514f9bdcc21d9fa0a7348de0e5bd27fdf159081..6dfef716482b7d7abb7c9602ebb831e765da0267 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -1,4 +1,4 @@
-$Id: THANKS,v 1.76 2003/02/11 09:26:35 stelian Exp $
+$Id: THANKS,v 1.77 2003/02/11 12:43:44 stelian Exp $
 
 Dump and restore were written by the people of the CSRG at the University
 of California, Berkeley.
@@ -26,6 +26,7 @@ Matthias Andree               matthias.andree@stud.uni-dortmund.de
 Andrea Arcangeli       andrea@suse.de
 Stephen Atwell         satwell@urbana.css.mot.com
 Gerd Bavendiek         bav@epost.de
+Fabrice Bellet         fabrice@bellet.info
 Stan Bubrouski         satan@fastdial.net
 Stephen Carr           sgcarr@civeng.adelaide.edu.au
 Rob Cermak             cermak@ahab.rutgers.edu
@@ -84,6 +85,7 @@ Dave Platt            dplatt@snulbug.mtview.ca.us
 Kenneth Porter         shiva@well.com
 Eric S. Raymond                esr@minx.thyrsus.com
 Graham Reed            greed@users.sourceforge.net
+Gunther Reiszig                gunther@mit.edu
 David Ronis            ronis@ronispc.chem.mcgill.ca
 Bernhard Sadlowski     sadlowsk@Mathematik.Uni-Bielefeld.DE
 Peter Samuel           peters@e-smith.com
index 145f769b949308e38e343a60bd7bbaf4f2e7c098..9bfb4c5051e74098d6cfa38670cf84d8fcf36ce9 100644 (file)
@@ -46,7 +46,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: tape.c,v 1.68 2003/02/11 09:56:48 stelian Exp $";
+       "$Id: tape.c,v 1.69 2003/02/11 12:43:45 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -286,7 +286,7 @@ setup(void)
                temptape = magtape;
 
 #ifdef RRESTORE
-       if (host)
+       if (!Afile && host)
                mt = rmtopen(temptape, O_RDONLY);
        else
 #endif
@@ -295,7 +295,7 @@ setup(void)
        else
                mt = OPEN(temptape, O_RDONLY, 0);
        if (mt < 0)
-               err(1, "%s", magtape);
+               err(1, "%s", temptape);
        if (!Afile) {
                volno = 1;
                setmagtapein();
@@ -502,6 +502,13 @@ again:
                return;
        }
        closemt();
+
+       /* 
+        * if using an archive file, reset its name so readtape()
+        * could properly use remote access.
+        */
+       Afile = NULL;
+
        if (Mflag) {
                snprintf(magtape, MAXPATHLEN, "%s%03ld", magtapeprefix, newvol);
                magtape[MAXPATHLEN - 1] = '\0';
@@ -1487,7 +1494,7 @@ readtape(char *buf)
 #endif
 getmore:
 #ifdef RRESTORE
-       if (host)
+       if (!Afile && host)
                i = rmtread(&tapebuf[rd], cnt);
        else
 #endif
@@ -1549,7 +1556,7 @@ getmore:
                i = ntrec * TP_BSIZE;
                memset(tapebuf, 0, (size_t)i);
 #ifdef RRESTORE
-               if (host)
+               if (!Afile && host)
                        seek_failed = (rmtseek(i, 1) < 0);
                else
 #endif
@@ -2030,7 +2037,7 @@ static int read_a_block(int fd, char *buf, size_t len, long *lengthread)
        size = len;
        while (size > 0) {
 #ifdef RRESTORE
-               if (host)
+               if (!Afile && host)
                        i = rmtread(buf, size);
                else
 #endif
@@ -2054,7 +2061,7 @@ closemt(void)
        if (mt < 0)
                return;
 #ifdef RRESTORE
-       if (host)
+       if (!Afile && host)
                rmtclose();
        else
 #endif