mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Fix yes_no_prompt() error handling.
This commit is contained in:
parent
b496a6b227
commit
ae9c3f1664
@ -1,5 +1,7 @@
|
||||
Version 2.01.15 -
|
||||
=================================
|
||||
Fix yes_no_prompt() error handling.
|
||||
Add lvm.conf comment warning against multiple filter lines.
|
||||
Tidy lvmconf.sh.
|
||||
Add format1 dev_write debug messages.
|
||||
Add clustered VG attribute to report.
|
||||
|
@ -350,21 +350,30 @@ int segtype_arg(struct cmd_context *cmd, struct arg *a)
|
||||
|
||||
char yes_no_prompt(const char *prompt, ...)
|
||||
{
|
||||
int c = 0;
|
||||
int c = 0, ret = 0;
|
||||
va_list ap;
|
||||
|
||||
while (c != 'y' && c != 'n') {
|
||||
if (c == '\n' || c == 0) {
|
||||
do {
|
||||
if (c == '\n' || !c) {
|
||||
va_start(ap, prompt);
|
||||
vprintf(prompt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
c = tolower(getchar());
|
||||
}
|
||||
|
||||
while (getchar() != '\n') ;
|
||||
if ((c = getchar()) == EOF) {
|
||||
ret = 'n';
|
||||
break;
|
||||
}
|
||||
|
||||
return c;
|
||||
c = tolower(c);
|
||||
if ((c == 'y') || (c == 'n'))
|
||||
ret = c;
|
||||
} while (!ret || c != '\n');
|
||||
|
||||
if (c != '\n')
|
||||
printf("\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void __alloc(int size)
|
||||
|
Loading…
Reference in New Issue
Block a user