projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
runtests
[awesomized/libmemcached]
/
test
/
lib
/
Server.cpp
diff --git
a/test/lib/Server.cpp
b/test/lib/Server.cpp
index 2744f3e1b9c1876b895cb056d6905518cfb534c4..dddb68d9f733ceecf98da9ae9f3e5bca83bce323 100644
(file)
--- a/
test/lib/Server.cpp
+++ b/
test/lib/Server.cpp
@@
-117,7
+117,7
@@
optional<Server::ChildProc> Server::start() {
return ChildProc{pid, pipe};
}
return ChildProc{pid, pipe};
}
-bool Server::isListening() {
+bool Server::isListening()
const
{
MemcachedPtr memc;
if (holds_alternative<string>(socket_or_port)) {
MemcachedPtr memc;
if (holds_alternative<string>(socket_or_port)) {
@@
-149,11
+149,16
@@
bool Server::isListening() {
}
bool Server::ensureListening() {
}
bool Server::ensureListening() {
+ if (!start()) {
+ return false;
+ }
return Retry{[this] {
again:
start();
if (!isListening()) {
return Retry{[this] {
again:
start();
if (!isListening()) {
- if (tryWait()){
+ auto old = pid;
+ if (tryWait()) {
+ cerr << "Collected zombie " << *this << "(old pid=" << old << ")\n";
goto again;
}
}
goto again;
}
}
@@
-186,7
+191,8
@@
bool Server::check() {
bool Server::wait(int flags) {
if (pid && pid == waitpid(pid, &status, flags)) {
bool Server::wait(int flags) {
if (pid && pid == waitpid(pid, &status, flags)) {
- if (drain().length() && output != "Signal handled: Terminated.\n") {
+ if (drain().length() &&
+ output.rfind("Signal handled: Terminated", 0) != 0) {
cerr << "Output of " << *this << ":\n";
istringstream iss{output};
cerr << "Output of " << *this << ":\n";
istringstream iss{output};