summaryrefslogtreecommitdiffstats
path: root/lib/display/display.c
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2012-08-26 00:15:45 +0100
committerAlasdair G Kergon <agk@redhat.com>2012-08-26 00:15:45 +0100
commit3acc85caa8d313b8c21e4bef7f84601731e74b2b (patch)
treed9de1cab92f87c6cb45285957ef18e26266714ed /lib/display/display.c
parent438e0050dfed1f8f2d74670a5f7c5e8c8819c777 (diff)
downloadlvm2-3acc85caa8d313b8c21e4bef7f84601731e74b2b.tar.gz
lvm2-3acc85caa8d313b8c21e4bef7f84601731e74b2b.tar.xz
lvm2-3acc85caa8d313b8c21e4bef7f84601731e74b2b.zip
buffering: use unbuffered silent mode for liblvm
Disable private buffering when using liblvm. When private stdin/stdout buffering is not used always use silent mode.
Diffstat (limited to 'lib/display/display.c')
-rw-r--r--lib/display/display.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/display/display.c b/lib/display/display.c
index 2422b51e..b15ff71c 100644
--- a/lib/display/display.c
+++ b/lib/display/display.c
@@ -902,11 +902,19 @@ void display_segtypes(const struct cmd_context *cmd)
}
}
+/*
+ * Prompt for y or n from stdin.
+ * Defaults to 'no' in silent mode.
+ * All callers should support --yes and/or --force to override this.
+ */
char yes_no_prompt(const char *prompt, ...)
{
int c = 0, ret = 0;
va_list ap;
+ if (silent_mode())
+ return 'n';
+
sigint_allow();
do {
if (c == '\n' || !c) {
@@ -939,4 +947,3 @@ char yes_no_prompt(const char *prompt, ...)
return ret;
}
-