Define a type for signal handlers

pull/117/head
Nils Maier 2013-08-18 05:59:52 +02:00
parent 79fcafc31f
commit bf5a940ed4
2 changed files with 6 additions and 5 deletions

View File

@ -1237,8 +1237,8 @@ bool isNumericHost(const std::string& name)
namespace {
static Lock win_signal_lock;
static void(*win_int_handler)(int) = nullptr;
static void(*win_term_handler)(int) = nullptr;
static signal_handler_t win_int_handler = nullptr;
static signal_handler_t win_term_handler = nullptr;
static void win_ign_handler(int) {}
@ -1279,7 +1279,7 @@ namespace {
}
#endif
void setGlobalSignalHandler(int sig, sigset_t* mask, void (*handler)(int),
void setGlobalSignalHandler(int sig, sigset_t* mask, signal_handler_t handler,
int flags) {
#if _WIN32
if (sig == SIGINT || sig == SIGTERM) {

View File

@ -334,8 +334,9 @@ char toLowerChar(char c);
bool isNumericHost(const std::string& name);
void setGlobalSignalHandler(int signal, sigset_t* mask, void (*handler)(int),
int flags);
typedef void(*signal_handler_t)(int);
void setGlobalSignalHandler(int signal, sigset_t* mask,
signal_handler_t handler, int flags);
std::string getHomeDir();