summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2018-09-18 00:06:29 +0200
committerTom Smeding <tom.smeding@gmail.com>2018-09-18 00:07:01 +0200
commit0624562e3e1ae24fd1df66e3e38afca7b0f1c70f (patch)
tree89efc54b78135f5625fd69a03b89dee8b7d78353 /main.cpp
parent44182a1be82d5e5df6f7b1a3c85dd7386b397007 (diff)
Fix bugs
- Cleanup open file descriptors properly - Use cout, not cerr - Better error logging, including when a program is killed by a signal
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.cpp b/main.cpp
index ecf48df..edcafb1 100644
--- a/main.cpp
+++ b/main.cpp
@@ -313,7 +313,10 @@ match_done:
bool success = procs[i].writeLine("Stop");
procs[i].unStop();
if (success) usleep(10000);
- procs[i].terminate();
+ int ret = procs[i].terminate();
+ if (ret != 0 && ret != 1009) {
+ cout << "Player " << i+1 << " exited with code " << ret << endl;
+ }
}
gMultiLog.append(logId, mres.describe(p1, p2));