mirror of https://github.com/aria2/aria2
Define a type for signal handlers
parent
79fcafc31f
commit
bf5a940ed4
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue