diff --git a/commands/simple/fsck.c b/commands/simple/fsck.c index 1901ce21c..a1ef8edd7 100755 --- a/commands/simple/fsck.c +++ b/commands/simple/fsck.c @@ -248,18 +248,21 @@ int yes(question) char *question; { register int c, answerchar; + static int note = 0; if (!repair) { printf("\n"); return(0); } printf("%s? ", question); + if(!note) { printf("(y=yes, n=no, q=quit, A=for yes to all) "); note = 1; } if (automatic) { printf("yes\n"); return(1); } fflush(stdout); if ((c = answerchar = getchar()) == 'q' || c == 'Q') exit(1); + if(c == 'A') { automatic = 1; c = 'y'; } while (!eoln(c)) c = getchar(); return !(answerchar == 'n' || answerchar == 'N'); } @@ -670,8 +673,6 @@ int nblk; register i; register bitchunk_t *p = bitmap; - printf("writing bitmap - %d blocks from block %d\n", - nblk, bno); for (i = 0; i < nblk; i++, bno++, p += WORDS_PER_BLOCK) devwrite(btoa(bno), (char *) p, block_size); } diff --git a/commands/simple/mkfs.c b/commands/simple/mkfs.c index b7c76c279..25d01ae56 100755 --- a/commands/simple/mkfs.c +++ b/commands/simple/mkfs.c @@ -316,6 +316,13 @@ char *argv[]; grpid = BINGRP; simple = 1; } + + if(ULONG_MAX / block_size <= blocks-1) { + fprintf(stderr, "Warning: too big for filesystem to currently\n"); + fprintf(stderr, "run on (max 4GB), truncating.\n"); + blocks = ULONG_MAX / block_size; + } + nrblocks = blocks; nrinodes = inodes; @@ -323,11 +330,6 @@ char *argv[]; special(argv[--optind]); #ifdef UNIX - if(ULONG_MAX / block_size <= blocks-1) { - fprintf(stderr, "Device too big for filesystem to currently run on (max 4GB).\n"); - return 1; - } - if (!donttest) { short *testb; ssize_t w;