From 8e94528d6f26f0b5fe378e9a01fd1ec04c214832 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Tue, 24 Nov 2015 15:57:17 +0100 Subject: [PATCH] Improved signal and UDP bind debugging information, decreased verbosity of windows SHM errors. --- lib/config.cpp | 2 +- lib/shared_memory.cpp | 2 +- lib/socket.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/config.cpp b/lib/config.cpp index 660c07d5..15629e4d 100644 --- a/lib/config.cpp +++ b/lib/config.cpp @@ -453,7 +453,7 @@ void Util::Config::activate() { /// a SIGINT, SIGHUP or SIGTERM signal, reaps children for the SIGCHLD /// signal, and ignores all other signals. void Util::Config::signal_handler(int signum, siginfo_t * sigInfo, void * ignore) { - HIGH_MSG("Received signal %d from process %d", signum, sigInfo->si_pid); + HIGH_MSG("Received signal %s (%d) from process %d", strsignal(signum), signum, sigInfo->si_pid); switch (signum) { case SIGINT: //these three signals will set is_active to false. case SIGHUP: diff --git a/lib/shared_memory.cpp b/lib/shared_memory.cpp index c4fc6751..8b678be4 100644 --- a/lib/shared_memory.cpp +++ b/lib/shared_memory.cpp @@ -353,7 +353,7 @@ namespace IPC { } while (i < 10 && !handle && autoBackoff); } if (!handle) { - FAIL_MSG("%s for page %s failed with error code %u", (master ? "CreateFileMapping" : "OpenFileMapping"), name.c_str(), GetLastError()); + MEDIUM_MSG("%s for page %s failed with error code %u", (master ? "CreateFileMapping" : "OpenFileMapping"), name.c_str(), GetLastError()); return; } mapped = (char *)MapViewOfFile(handle, FILE_MAP_ALL_ACCESS, 0, 0, 0); diff --git a/lib/socket.cpp b/lib/socket.cpp index f197bd36..be206a29 100644 --- a/lib/socket.cpp +++ b/lib/socket.cpp @@ -1157,7 +1157,7 @@ int Socket::UDPConnection::bind(int port) { return ntohs(s4.sin_port); } - DEBUG_MSG(DLVL_FAIL, "Could not bind UDP socket to port %d", port); + DEBUG_MSG(DLVL_FAIL, "Could not bind UDP socket to port %d: %s", port, strerror(errno)); return 0; }