Defines a signal handler for win32 and *nix.
More...
#include <util.h>
Defines a signal handler for win32 and *nix.
Definition at line 159 of file util.h.
◆ install()
template<typename T >
| static bool tools::signal_handler::install |
( |
T |
t | ) |
|
|
inlinestatic |
installs a signal handler
Definition at line 164 of file util.h.
167 bool r = TRUE == ::SetConsoleCtrlHandler(&win_handler, TRUE);
174 static struct sigaction sa;
175 memset(&sa, 0,
sizeof(
struct sigaction));
176 sa.sa_handler = posix_handler;
179 sigaction(SIGINT, &sa, NULL);
180 signal(SIGTERM, posix_handler);
181 signal(SIGPIPE, SIG_IGN);
The documentation for this class was generated from the following files:
- /home/abuild/rpmbuild/BUILD/electroneum-5.0.0.4/src/common/util.h
- /home/abuild/rpmbuild/BUILD/electroneum-5.0.0.4/src/common/util.cpp