[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1395162718-22586-1-git-send-email-psusi@ubuntu.com>
Date: Tue, 18 Mar 2014 13:11:58 -0400
From: Phillip Susi <psusi@...ntu.com>
To: linux-ext4@...r.kernel.org
Subject: [PATCH] mke2fs: don't interact with a non tty
mke2fs displays an interactive y/n prompt for certain situations.
This is not appropriate to do when stdin is not a tty.
Signed-off-by: Phillip Susi <psusi@...ntu.com>
---
misc/util.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/misc/util.c b/misc/util.c
index 92ab79f..c469744 100644
--- a/misc/util.c
+++ b/misc/util.c
@@ -71,6 +71,8 @@ void proceed_question(void)
char buf[256];
const char *short_yes = _("yY");
+ if (!isatty(0))
+ return;
fflush(stdout);
fflush(stderr);
fputs(_("Proceed anyway? (y,n) "), stdout);
--
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists