X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=blobdiff_plain;f=dump%2Fmain.c;h=508ec15fab28d3734a7e8bcc90b6535ffef42bf6;hp=173ec03a38026b54edb60f51a0594169080f2492;hb=c993d83a80c45bdf72ac623bd7f25766c6cb7682;hpb=fceb4f25728fd34fabfad406c32c5d8c142aae90 diff --git a/dump/main.c b/dump/main.c index 173ec03..508ec15 100644 --- a/dump/main.c +++ b/dump/main.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: main.c,v 1.72 2002/06/05 13:29:15 stelian Exp $"; + "$Id: main.c,v 1.77 2002/11/15 09:49:40 stelian Exp $"; #endif /* not lint */ #include @@ -181,7 +181,7 @@ long uncomprblks = 0;/* uncompressed blocks written */ char *__progname; #endif -int maxbsize = 64*1024; /* XXX MAXBSIZE from sys/param.h */ +int maxbsize = 1024*1024; /* XXX MAXBSIZE from sys/param.h */ static long numarg __P((const char *, long, long)); static void obsolete __P((int *, char **[])); static void usage __P((void)); @@ -293,7 +293,7 @@ main(int argc, char *argv[]) case 'b': /* blocks per tape write */ ntrec = numarg("number of blocks per write", - 1L, 1000L); + 1L, 1048576L); if (ntrec > maxbsize/1024) { msg("Please choose a blocksize <= %dkB\n", maxbsize/1024); @@ -711,9 +711,7 @@ main(int argc, char *argv[]) if (TP_BSIZE != (1 << tp_bshift)) quit("TP_BSIZE (%d) is not a power of 2", TP_BSIZE); maxino = fs->super->s_inodes_count + 1; -#if 0 spcl.c_flags |= DR_NEWINODEFMT; -#endif #else /* __linux __*/ if ((diskfd = open(disk, O_RDONLY)) < 0) { msg("Cannot open %s\n", disk); @@ -881,10 +879,10 @@ main(int argc, char *argv[]) /* print QFA-file header */ snprintf(gTps, sizeof(gTps), "%s\n%s\n%ld\n\n", QFA_MAGIC, QFA_VERSION, (unsigned long)spcl.c_date); gTps[sizeof(gTps) - 1] = '\0'; - if (write(gTapeposfd, gTps, strlen(gTps)) != strlen(gTps)) + if (write(gTapeposfd, gTps, strlen(gTps)) != (ssize_t)strlen(gTps)) quit("can't write tapeposfile\n"); sprintf(gTps, "ino\ttapeno\ttapepos\n"); - if (write(gTapeposfd, gTps, strlen(gTps)) != strlen(gTps)) + if (write(gTapeposfd, gTps, strlen(gTps)) != (ssize_t)strlen(gTps)) quit("can't write tapeposfile\n"); } #endif /* USE_QFA */ @@ -1229,10 +1227,10 @@ do_exclude_ino(dump_ino_t ino, const char *reason) exit(X_STARTUP); } if (reason) - msg("Added inode %u to exclude list (%s)\n", + msg("Excluding inode %u (%s) from dump\n", ino, reason); else - msg("Added inode %u to exclude list\n", ino); + msg("Excluding inode %u from dump\n", ino); iexclude_list[iexclude_num++] = ino; } } @@ -1243,7 +1241,7 @@ do_exclude_ino_str(char * ino) { unsigned long inod; inod = strtoul(ino, &r, 10); - if (*r != '\0' || inod <= ROOTINO) { + if (( *r != '\0' && !isspace(*r) ) || inod <= ROOTINO) { msg("Invalid inode argument %s\n", ino); msg("The ENTIRE dump is aborted.\n"); exit(X_STARTUP);