X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=dump%2Ftraverse.c;h=3886b479ae14a0ef354e8db4311c0c372a497922;hb=008af4194627f2026f9a66f38953724c0c364c81;hp=116d4f3bbedfc84bff5232b8c6c1674766443301;hpb=2f562f4e49eeaf0188ed8fc41c785e3dcd9e46a5;p=dump.git diff --git a/dump/traverse.c b/dump/traverse.c index 116d4f3..3886b47 100644 --- a/dump/traverse.c +++ b/dump/traverse.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: traverse.c,v 1.50 2002/08/18 20:52:05 stelian Exp $"; + "$Id: traverse.c,v 1.55 2003/03/30 15:40:37 stelian Exp $"; #endif /* not lint */ #include @@ -134,6 +130,17 @@ typedef ino_t ext2_ino_t; #ifndef EXT2_RESIZE_INO #define EXT2_RESIZE_INO 7 #endif +#ifndef EXT2_FT_UNKNOWN +#define EXT2_FT_UNKNOWN 0 +#define EXT2_FT_REG_FILE 1 +#define EXT2_FT_DIR 2 +#define EXT2_FT_CHRDEV 3 +#define EXT2_FT_BLKDEV 4 +#define EXT2_FT_FIFO 5 +#define EXT2_FT_SOCK 6 +#define EXT2_FT_SYMLINK 7 +#define EXT2_FT_MAX 8 +#endif int dump_fs_open(const char *disk, ext2_filsys *fs) { @@ -195,7 +202,7 @@ blockest(struct dinode const *dp) * dump blocks (sizeest vs. blkest in the indirect block * calculation). */ - blkest = howmany((u_quad_t)dp->di_blocks*fs->blocksize, TP_BSIZE); + blkest = howmany((u_quad_t)dp->di_blocks * 512, TP_BSIZE); i_size = dp->di_size + ((u_quad_t) dp->di_size_high << 32); sizeest = howmany(i_size, TP_BSIZE); if (blkest > sizeest) @@ -825,7 +832,7 @@ dumpino(struct dinode *dp, dump_ino_t ino, int metaonly) nbi.di_uid = (((int32_t)dp->di_uidhigh) << 16) | dp->di_uid; nbi.di_gid = (((int32_t)dp->di_gidhigh) << 16) | dp->di_gid; if (dp->di_file_acl) - warn("ACLs in inode #%ld won't be dumped", (long)ino); + msg("ACLs in inode #%ld won't be dumped\n", (long)ino); memmove(&spcl.c_dinode, &nbi, sizeof(nbi)); #else /* __linux__ */ spcl.c_dinode = *dp; @@ -1083,7 +1090,7 @@ dumpdirino(struct dinode *dp, dump_ino_t ino) nbi.di_uid = (((int32_t)dp->di_uidhigh) << 16) | dp->di_uid; nbi.di_gid = (((int32_t)dp->di_gidhigh) << 16) | dp->di_gid; if (dp->di_file_acl) - warn("ACLs in inode #%ld won't be dumped", (long)ino); + msg("ACLs in inode #%ld won't be dumped\n", (long)ino); memmove(&spcl.c_dinode, &nbi, sizeof(nbi)); #else /* __linux__ */ spcl.c_dinode = *dp; @@ -1346,7 +1353,7 @@ loop: else msg("short read error from %s: [block %d, ext2blk %d]: count=%d, got=%d\n", disk, blkno, dbtofsb(sblock, blkno), size, cnt); - if (++breaderrors > breademax) { + if (breademax && ++breaderrors > breademax) { msg("More than %d block read errors from %d\n", breademax, disk); broadcast("DUMP IS AILING!\n");