Make e2fsck -cc warn on a read-only root filesystem

Don't let the user run e2fsck -ccn on the root partition, without warning 
that he or she might be doing something Really Stupid.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

diff --git a/e2fsck/unix.c b/e2fsck/unix.c
index 4e1b814..63d355e 100644
--- a/e2fsck/unix.c
+++ b/e2fsck/unix.c
@@ -179,15 +179,18 @@
 	}
 
 	/*
-	 * If the filesystem isn't mounted, or it's the root filesystem
-	 * and it's mounted read-only, then everything's fine.
+	 * If the filesystem isn't mounted, or it's the root
+	 * filesystem and it's mounted read-only, and we're not doing
+	 * a read/write check, then everything's fine.
 	 */
 	if ((!(ctx->mount_flags & EXT2_MF_MOUNTED)) ||
 	    ((ctx->mount_flags & EXT2_MF_ISROOT) &&
-	     (ctx->mount_flags & EXT2_MF_READONLY)))
+	     (ctx->mount_flags & EXT2_MF_READONLY) &&
+	     !(ctx->options & E2F_OPT_WRITECHECK)))
 		return;
 
-	if (ctx->options & E2F_OPT_READONLY) {
+	if ((ctx->options & E2F_OPT_READONLY) &&
+	    !(ctx->options & E2F_OPT_WRITECHECK)) {
 		printf(_("Warning!  %s is mounted.\n"), ctx->filesystem_name);
 		return;
 	}