diff --git a/CHANGELOG.md b/CHANGELOG.md index 3dc24cbaa..5562c92bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - ADDED: Node bindings can return pre-rendered JSON buffer. [#5189](https://github.com/Project-OSRM/osrm-backend/pull/5189) - Bugfixes: - FIXED: collapsing of ExitRoundabout instructions [#5114](https://github.com/Project-OSRM/osrm-backend/issues/5114) + - FIXED: fix osrm-routed gdb not work issue [#5156](https://github.com/Project-OSRM/osrm-backend/issues/5156) - FIXED: negative distances in table plugin annotation [#5106](https://github.com/Project-OSRM/osrm-backend/issues/5106) - Misc: - CHANGED: Support up to 512 named shared memory regions [#5185](https://github.com/Project-OSRM/osrm-backend/pull/5185) diff --git a/src/tools/routed.cpp b/src/tools/routed.cpp index 66236d527..25a62b03a 100644 --- a/src/tools/routed.cpp +++ b/src/tools/routed.cpp @@ -70,8 +70,8 @@ std::istream &operator>>(std::istream &in, EngineConfig::Algorithm &algorithm) throw util::RuntimeError(token, ErrorCode::UnknownAlgorithm, SOURCE_REF); return in; } -} -} +} // namespace engine +} // namespace osrm // generate boost::program_options object for the routing part inline unsigned generateServerProgramOptions(const int argc, @@ -273,10 +273,12 @@ int main(int argc, const char *argv[]) try #ifndef _WIN32 int sig = 0; - sigset_t new_mask; - sigset_t old_mask; - sigfillset(&new_mask); - pthread_sigmask(SIG_BLOCK, &new_mask, &old_mask); + sigset_t wait_mask; + sigemptyset(&wait_mask); + sigaddset(&wait_mask, SIGINT); + sigaddset(&wait_mask, SIGQUIT); + sigaddset(&wait_mask, SIGTERM); + pthread_sigmask(SIG_BLOCK, &wait_mask, nullptr); // only block necessary signals #endif auto service_handler = std::make_unique(config); @@ -298,19 +300,13 @@ int main(int argc, const char *argv[]) try std::thread server_thread(std::move(server_task)); #ifndef _WIN32 - sigset_t wait_mask; - pthread_sigmask(SIG_SETMASK, &old_mask, nullptr); - sigemptyset(&wait_mask); - sigaddset(&wait_mask, SIGINT); - sigaddset(&wait_mask, SIGQUIT); - sigaddset(&wait_mask, SIGTERM); - pthread_sigmask(SIG_BLOCK, &wait_mask, nullptr); util::Log() << "running and waiting for requests"; if (std::getenv("SIGNAL_PARENT_WHEN_READY")) { kill(getppid(), SIGUSR1); } sigwait(&wait_mask, &sig); + util::Log() << "received signal " << sig; #else // Set console control handler to allow server to be stopped. console_ctrl_function = std::bind(&server::Server::Stop, routing_server);