ref: refs/heads/master
commit a60488e3ecb0213042d11d9bd05e7e07f1ced6e1
Author: Ján Kupec
Date: Sun Feb 15 18:10:06 2009 +0100
Return default on EOF after poll() in read_action_ari_with_timout().
---
src/utils/prompt.cc | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/utils/prompt.cc b/src/utils/prompt.cc
index fb785f4..4a9ddf6 100644
--- a/src/utils/prompt.cc
+++ b/src/utils/prompt.cc
@@ -145,6 +145,14 @@ read_action_ari_with_timeout(PromptId pid, unsigned timeout, int default_action)
do {} while (getchar() != '\n');
return reply_int;
}
+ else if (feof(stdin))
+ {
+ zypper.out().info(zypp::str::form(_("Retrying in %u seconds..."), timeout));
+ WAR << "no good input, returning " << default_action
+ << " in " << timeout << " seconds." << endl;
+ sleep(timeout);
+ return default_action;
+ }
else
WAR << "Unknown char " << reply << endl;
}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org