X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=restore%2Frestore.c;h=7c897eceeb4301a1380b8a2c1f9359fdc2f42aec;hb=2be7779919f3c53ac42a5ac63c0d381e401f7587;hp=eba23e13e939584427390ba50949fa4a9249a5c4;hpb=792ff63acf448f21a3ef2869e4bbcdbf4f7f87f2;p=dump.git diff --git a/restore/restore.c b/restore/restore.c index eba23e1..7c897ec 100644 --- a/restore/restore.c +++ b/restore/restore.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: restore.c,v 1.28 2002/02/04 11:21:20 stelian Exp $"; + "$Id: restore.c,v 1.30 2002/07/19 14:57:40 stelian Exp $"; #endif /* not lint */ #include @@ -159,7 +159,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 +746,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 +797,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 @@ -950,7 +951,7 @@ createfiles(void) 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; @@ -1022,14 +1023,14 @@ createfiles(void) 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 */