summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2018-09-17 22:59:09 +0200
committerTom Smeding <tom.smeding@gmail.com>2018-09-17 22:59:09 +0200
commitb9fe622b6f3b3a0abba1eee0d71285c7329c89d2 (patch)
treeedc38ddda352775f14f51cba4625fc5f66de6b03
parentfca6e0750b83f337c61b994a191b8463585ea655 (diff)
Catch SIGPIPE to prevent spurious exiting
-rw-r--r--main.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index c863cca..ecf48df 100644
--- a/main.cpp
+++ b/main.cpp
@@ -15,6 +15,7 @@
#include <cassert>
#include <errno.h>
#include <unistd.h>
+#include <signal.h>
#include <sys/stat.h>
#include <sys/time.h>
#include "scheduler.h"
@@ -360,6 +361,8 @@ int main(int argc, char **argv) {
mkdirp(playerlogdir);
mkdirp(gamelogdir);
+ signal(SIGPIPE, [](int){});
+
Scheduler scheduler(num_threads);
fullCompetition(scheduler, players, params);
scheduler.finish();