summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/Client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IceGrid/Client.cpp')
-rw-r--r--cpp/src/IceGrid/Client.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/cpp/src/IceGrid/Client.cpp b/cpp/src/IceGrid/Client.cpp
index ad68747e51a..074d479d040 100644
--- a/cpp/src/IceGrid/Client.cpp
+++ b/cpp/src/IceGrid/Client.cpp
@@ -439,16 +439,24 @@ Client::run(int argc, char* argv[])
}
else
{
- while(id.empty())
+ while(id.empty() && cin.good())
{
cout << "user id: " << flush;
getline(cin, id);
+ if(!cin.good())
+ {
+ return EXIT_FAILURE;
+ }
id = IceUtilInternal::trim(id);
}
if(password.empty())
{
password = getPassword("password: ");
+ if(!cin.good())
+ {
+ return EXIT_FAILURE;
+ }
}
session = AdminSessionPrx::uncheckedCast(router->createSession(id, password));
@@ -574,16 +582,24 @@ Client::run(int argc, char* argv[])
}
else
{
- while(id.empty())
+ while(id.empty() && cin.good())
{
cout << "user id: " << flush;
getline(cin, id);
+ if(!cin.good())
+ {
+ return EXIT_FAILURE;
+ }
id = IceUtilInternal::trim(id);
}
if(password.empty())
{
password = getPassword("password: ");
+ if(!cin.good())
+ {
+ return EXIT_FAILURE;
+ }
}
session = registry->createAdminSession(id, password);