From 86e0b1bc13d2a0e034c5a80fee054166d7465690 Mon Sep 17 00:00:00 2001 From: dongresource Date: Tue, 8 Dec 2020 20:10:02 +0100 Subject: [PATCH] EINTR is not crash-worthy This is how it should have been handled anyway. This fixes a (benign) race condition when the server is killed, as well as gprof builds. Also updated tdata. --- src/CNProtocol.cpp | 4 ++++ tdata | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/CNProtocol.cpp b/src/CNProtocol.cpp index 69047bb..baa559e 100644 --- a/src/CNProtocol.cpp +++ b/src/CNProtocol.cpp @@ -312,6 +312,10 @@ void CNServer::start() { // the timeout is to ensure shard timers are ticking int n = poll(fds.data(), fds.size(), 50); if (SOCKETERROR(n)) { +#ifndef _WIN32 + if (errno == EINTR) + continue; +#endif std::cout << "[FATAL] poll() returned error" << std::endl; terminate(0); } diff --git a/tdata b/tdata index e9e03fd..9a39919 160000 --- a/tdata +++ b/tdata @@ -1 +1 @@ -Subproject commit e9e03fd0f0ddc09a29db03cc68a5e5276712f2a7 +Subproject commit 9a3991958689087a5846cac71edd16c82edbf09d