X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;ds=sidebyside;f=restore%2Ftape.c;h=8b546791d964b183bb7a7ae7ce5bd1f49f67cd0d;hb=e531c44203905d5554118c09c8d0267f17879ee6;hp=b9d0b02635f2c9d3629083a38ce4d3e2bfb30c07;hpb=a18d599791e977f3e3d26123031e6ed4e64d6d08;p=dump.git diff --git a/restore/tape.c b/restore/tape.c index b9d0b02..8b54679 100644 --- a/restore/tape.c +++ b/restore/tape.c @@ -46,7 +46,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.63 2002/07/19 14:57:40 stelian Exp $"; + "$Id: tape.c,v 1.65 2002/11/15 09:25:42 stelian Exp $"; #endif /* not lint */ #include @@ -285,7 +285,7 @@ setup(void) #ifdef RRESTORE if (host) - mt = rmtopen(temptape, "O_RDONLY"); + mt = rmtopen(temptape, O_RDONLY); else #endif if (pipein) @@ -374,15 +374,9 @@ setup(void) getfile(xtrmap, xtrmapskip); while (spcl.c_type == TS_ADDR) { /* Recompute maxino and the map */ - char *oldmap = usedinomap; dump_ino_t oldmaxino = maxino; maxino += (spcl.c_count * TP_BSIZE * NBBY) + 1; - map = calloc((unsigned)1, (unsigned)howmany(maxino, NBBY)); - if (map == NULL) - errx(1, "no memory for active inode map"); - usedinomap = map; - memcpy(usedinomap, oldmap, howmany(oldmaxino, NBBY)); - free(oldmap); + resizemaps(oldmaxino, maxino); spcl.c_dinode.di_size = spcl.c_count * TP_BSIZE; getfile(xtrmap, xtrmapskip); @@ -541,7 +535,7 @@ again: } #ifdef RRESTORE if (host) - mt = rmtopen(magtape, "O_RDONLY"); + mt = rmtopen(magtape, O_RDONLY); else #endif mt = OPEN(magtape, O_RDONLY, 0);