X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=restore%2Frestore.c;h=5ac6c870d56949ffe319a22414672f92c05869ce;hb=83a6b4df0b7b7aecc0d3940549d0d480adff35a6;hp=2a398fc18816e9c7e5ada0ca2fb4c11c856d139b;hpb=fe0e02857a1ff7db4bf8cb28780de7ecf2f24234;p=dump.git diff --git a/restore/restore.c b/restore/restore.c index 2a398fc..5ac6c87 100644 --- a/restore/restore.c +++ b/restore/restore.c @@ -18,11 +18,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -41,7 +37,7 @@ #ifndef lint static const char rcsid[] = - "$Id: restore.c,v 1.27 2002/02/04 11:18:46 stelian Exp $"; + "$Id: restore.c,v 1.31 2003/03/30 15:40:39 stelian Exp $"; #endif /* not lint */ #include @@ -159,7 +155,7 @@ addfile(char *name, dump_ino_t ino, int type) */ /* ARGSUSED */ long -deletefile(char *name, dump_ino_t ino, int type) +deletefile(char *name, dump_ino_t ino, UNUSED(int type)) { long descend = hflag ? GOOD : FAIL; struct entry *ep; @@ -746,6 +742,7 @@ createleaves(char *symtabfile) struct entry *ep; dump_ino_t first; long curvol; + int doremove; if (command == 'R') { Vprintf(stdout, "Continue extraction of new leaves\n"); @@ -796,11 +793,11 @@ createleaves(char *symtabfile) * be removed since its type may change from one leaf type * to another (e.g. "file" to "character special"). */ - if ((ep->e_flags & EXTRACT) != 0) { - removeleaf(ep); - ep->e_flags &= ~REMOVED; - } - (void) extractfile(myname(ep)); + if ((ep->e_flags & EXTRACT) != 0) + doremove = 1; + else + doremove = 0; + (void) extractfile(ep, doremove); ep->e_flags &= ~(NEW|EXTRACT); /* * We checkpoint the restore after every tape reel, so @@ -931,15 +928,10 @@ createfiles(void) if (GetTapePos(&curtpos) == 0) msg("before resync at tape position %lld (%ld, %ld, %s)\n", curtpos, next, curfile.ino, curfile.name); #endif -msg("bobo1\n"); ReReadInodeFromTape(next); #ifdef DEBUG_QFA -msg("bobo2\n"); - if (GetTapePos(&curtpos) == 0) { -msg("bobo3\n"); + if (GetTapePos(&curtpos) == 0) msg("after resync at tape position %lld (%ld, %ld, %s)\n", curtpos, next, curfile.ino, curfile.name); -msg("bobo4\n"); - } #endif } } @@ -955,7 +947,7 @@ msg("bobo4\n"); if (volinfo[1] == ROOTINO) { int i, goodvol = 1; - for (i = 1; i < TP_NINOS && volinfo[i] != 0; ++i) + for (i = 1; i < (int)TP_NINOS && volinfo[i] != 0; ++i) if (volinfo[i] < next) goodvol = i; @@ -1027,14 +1019,14 @@ msg("bobo4\n"); msg("inode %ld at tapepos %ld\n", curfile.ino, curtapepos); #endif sprintf(gTps, "%ld\t%ld\t%lld\n", (unsigned long)curfile.ino, volno, curtapepos); - if (write(gTapeposfd, gTps, strlen(gTps)) != strlen(gTps)) + if (write(gTapeposfd, gTps, strlen(gTps)) != (ssize_t)strlen(gTps)) warn("error writing tapepos file.\n"); skipfile(); } else { msg("restoring %s\n", myname(ep)); #endif /* USE_QFA */ - (void) extractfile(myname(ep)); + (void) extractfile(ep, 0); #ifdef USE_QFA } #endif /* USE_QFA */