From: Stelian Pop Date: Tue, 11 Feb 2003 12:43:44 +0000 (+0000) Subject: Fixed restore to correctly access the archive file (-A argument) even when using... X-Git-Tag: release_0_4b34~16 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=2d32c89c9844547c83ef7a9ca97308da29e280cc;p=dump.git Fixed restore to correctly access the archive file (-A argument) even when using a remote tape. Corrected Gunther Reiszig's contact information. --- diff --git a/CHANGES b/CHANGES index dee0408..e3b0004 100644 --- 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 for reporting the bug. + to Gunther Reiszig 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 + for reporting the bug. Changes between versions 0.4b32 and 0.4b33 (released February 10, 2003) ======================================================================= diff --git a/THANKS b/THANKS index f514f9b..6dfef71 100644 --- 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 diff --git a/restore/tape.c b/restore/tape.c index 145f769..9bfb4c5 100644 --- a/restore/tape.c +++ b/restore/tape.c @@ -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 @@ -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