diff options
Diffstat (limited to 'gnuradio-runtime/lib/local_sighandler.cc')
-rw-r--r-- | gnuradio-runtime/lib/local_sighandler.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/gnuradio-runtime/lib/local_sighandler.cc b/gnuradio-runtime/lib/local_sighandler.cc index 97491b24d..7f96b2460 100644 --- a/gnuradio-runtime/lib/local_sighandler.cc +++ b/gnuradio-runtime/lib/local_sighandler.cc @@ -28,6 +28,7 @@ #include <stdio.h> #include <string.h> #include <stdexcept> +#include <boost/format.hpp> namespace gr { @@ -49,7 +50,7 @@ local_sighandler::local_sighandler(int signum, void (*new_handler)(int)) #endif } -local_sighandler::~local_sighandler() +local_sighandler::~local_sighandler() noexcept(false) { #ifdef HAVE_SIGACTION if (sigaction(d_signum, &d_old_action, 0) < 0) { @@ -70,7 +71,7 @@ void local_sighandler::throw_signal(int signum) { throw signal(signum); } std::string signal::name() const { - char tmp[128]; + std::string tmp; switch (signum()) { #ifdef SIGHUP @@ -167,18 +168,14 @@ std::string signal::name() const SIGNAME(SIGSYS); #endif default: -#if defined(HAVE_SNPRINTF) #if defined(SIGRTMIN) && defined(SIGRTMAX) if (signum() >= SIGRTMIN && signum() <= SIGRTMAX) { - snprintf(tmp, sizeof(tmp), "SIGRTMIN + %d", signum()); + tmp = str(boost::format("SIGRTMIN + %d") % signum()); return tmp; } #endif - snprintf(tmp, sizeof(tmp), "SIGNAL %d", signum()); + tmp = str(boost::format("SIGNAL %d") % signum()); return tmp; -#else - return "Unknown signal"; -#endif } } |