[PATCH] mke2fs: don't interact with a non tty

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux