diff options
author | Jose <jose@zeroc.com> | 2019-06-04 14:37:40 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2019-06-04 14:37:40 +0200 |
commit | 363c0ec87b41a4275b6a302075440f94082cff29 (patch) | |
tree | 843a91dadcdd45d61f80ddbc3f29072f6283f7d8 /cpp/src/IceGrid/Activator.cpp | |
parent | Cleanup Close #368 (diff) | |
download | ice-363c0ec87b41a4275b6a302075440f94082cff29.tar.bz2 ice-363c0ec87b41a4275b6a302075440f94082cff29.tar.xz ice-363c0ec87b41a4275b6a302075440f94082cff29.zip |
Fix bogus loop in IceGrid/Activator #403
Diffstat (limited to 'cpp/src/IceGrid/Activator.cpp')
-rw-r--r-- | cpp/src/IceGrid/Activator.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cpp/src/IceGrid/Activator.cpp b/cpp/src/IceGrid/Activator.cpp index 7982685b1f1..a1d8657d510 100644 --- a/cpp/src/IceGrid/Activator.cpp +++ b/cpp/src/IceGrid/Activator.cpp @@ -621,11 +621,14 @@ Activator::activate(const string& name, struct passwd pwbuf; vector<char> buffer(4096); // 4KB initial buffer size struct passwd *pw; - int err = getpwuid_r(uid, &pwbuf, &buffer[0], buffer.size(), &pw); - while(err == ERANGE && buffer.size() < 1024 * 1024) // Limit buffer to 1MB + + int err; + while((err = getpwuid_r(uid, &pwbuf, &buffer[0], buffer.size(), &pw)) == ERANGE && + buffer.size() < 1024 * 1024) // Limit buffer to 1M { buffer.resize(buffer.size() * 2); } + if(err != 0) { throw SyscallException(__FILE__, __LINE__, err); |