linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mke2fs: don't interact with a non tty
@ 2014-03-18 17:11 Phillip Susi
  2014-03-18 18:31 ` Andreas Dilger
  0 siblings, 1 reply; 9+ messages in thread
From: Phillip Susi @ 2014-03-18 17:11 UTC (permalink / raw)
  To: linux-ext4

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@ubuntu.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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-03-19 17:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-18 17:11 [PATCH] mke2fs: don't interact with a non tty Phillip Susi
2014-03-18 18:31 ` Andreas Dilger
2014-03-18 18:47   ` Phillip Susi
2014-03-19 11:26     ` Lukáš Czerner
2014-03-19 13:35       ` Phillip Susi
2014-03-19 15:16         ` Lukáš Czerner
2014-03-19 16:04           ` Phillip Susi
2014-03-19 17:05             ` Lukáš Czerner
2014-03-19 17:37               ` Phillip Susi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).