X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=restore%2Futilities.c;h=838ebe76ec284e9089a3cdf117a41ae8a2846d10;hb=83a6b4df0b7b7aecc0d3940549d0d480adff35a6;hp=e897344a1e0a85ef5bec3d5f0bdb9aee51fae362;hpb=fe0e02857a1ff7db4bf8cb28780de7ecf2f24234;p=dump.git diff --git a/restore/utilities.c b/restore/utilities.c index e897344..838ebe7 100644 --- a/restore/utilities.c +++ b/restore/utilities.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: utilities.c,v 1.20 2002/02/04 11:18:46 stelian Exp $"; + "$Id: utilities.c,v 1.22 2003/03/30 15:40:40 stelian Exp $"; #endif /* not lint */ #include @@ -543,3 +539,25 @@ Inode2Tapepos(dump_ino_t ino, long *tnum, long long *tpos, int exactmatch) return 0; } #endif /* USE_QFA */ + +void resizemaps(dump_ino_t oldmax, dump_ino_t newmax) +{ + char *map; + + if (usedinomap) { + map = calloc((unsigned)1, (unsigned)howmany(newmax, NBBY)); + if (map == NULL) + errx(1, "no memory for active inode map"); + memcpy(map, usedinomap, howmany(oldmax, NBBY)); + free(usedinomap); + usedinomap = map; + } + if (dumpmap) { + map = calloc((unsigned)1, (unsigned)howmany(newmax, NBBY)); + if (map == NULL) + errx(1, "no memory for file dump list"); + memcpy(map, dumpmap, howmany(oldmax, NBBY)); + free(dumpmap); + dumpmap = map; + } +}