From: Ben Gras Date: Mon, 4 Jul 2005 13:34:24 +0000 (+0000) Subject: . fsck has A for yes-to-all response X-Git-Tag: v3.1.0~648 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.dnssec-keyfromlabel.html?a=commitdiff_plain;h=5939b6a4d7de62b1bd9ac8d32b863891e2e3c0e6;p=minix.git . fsck has A for yes-to-all response . mkfs makes filesystems on devices >4GB, but truncates them at 4GB --- 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;