diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 82f8c34d..073a58bc 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,4 +1,10 @@ -1999-06-25 +1999-06-30 + + * unix.c (check_mount): Clean up the abort message displayed when + the filesystem is mounted and either stdout or stdin isn't + a tty. + +1999-06-25 * e2fsck.h: * pass1.c (pass1_get_blocks, pass1_read_inode, pass1_write_inode, diff --git a/e2fsck/unix.c b/e2fsck/unix.c index e25bbf39..ed8082d5 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -169,13 +169,15 @@ static void check_mount(e2fsck_t ctx) return; } - printf("%s is mounted.\n\n", ctx->device_name); - printf("\007\007\007\007WARNING!!! Running e2fsck on a mounted filesystem " - "may cause\nSEVERE filesystem damage.\007\007\007\n\n"); - if (isatty (0) && isatty (1)) - cont = ask_yn("Do you really want to continue", -1); - else - cont = 0; + printf("%s is mounted. ", ctx->device_name); + if (!isatty(0) || !isatty(1)) { + printf("Cannot continue, aborting.\n\n"); + exit(FSCK_ERROR); + } + printf("\n\n\007\007\007\007WARNING!!! " + "Running e2fsck on a mounted filesystem may cause\n" + "SEVERE filesystem damage.\007\007\007\n\n"); + cont = ask_yn("Do you really want to continue", -1); if (!cont) { printf ("check aborted.\n"); exit (0);