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 {
|
namespace {
|
||||||
static Lock win_signal_lock;
|
static Lock win_signal_lock;
|
||||||
|
|
||||||
static void(*win_int_handler)(int) = nullptr;
|
static signal_handler_t win_int_handler = nullptr;
|
||||||
static void(*win_term_handler)(int) = nullptr;
|
static signal_handler_t win_term_handler = nullptr;
|
||||||
|
|
||||||
static void win_ign_handler(int) {}
|
static void win_ign_handler(int) {}
|
||||||
|
|
||||||
|
@ -1279,7 +1279,7 @@ namespace {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void setGlobalSignalHandler(int sig, sigset_t* mask, void (*handler)(int),
|
void setGlobalSignalHandler(int sig, sigset_t* mask, signal_handler_t handler,
|
||||||
int flags) {
|
int flags) {
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
if (sig == SIGINT || sig == SIGTERM) {
|
if (sig == SIGINT || sig == SIGTERM) {
|
||||||
|
|
|
@ -334,8 +334,9 @@ char toLowerChar(char c);
|
||||||
|
|
||||||
bool isNumericHost(const std::string& name);
|
bool isNumericHost(const std::string& name);
|
||||||
|
|
||||||
void setGlobalSignalHandler(int signal, sigset_t* mask, void (*handler)(int),
|
typedef void(*signal_handler_t)(int);
|
||||||
int flags);
|
void setGlobalSignalHandler(int signal, sigset_t* mask,
|
||||||
|
signal_handler_t handler, int flags);
|
||||||
|
|
||||||
std::string getHomeDir();
|
std::string getHomeDir();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue