mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-10 12:12:31 +00:00
Merge branch 'pr/127'
This commit is contained in:
@@ -76,8 +76,15 @@ SignalHandler::set_handler(unsigned int signum, slot_void slot) {
|
||||
if (!slot)
|
||||
throw std::logic_error("SignalHandler::set_handler(...) received an empty slot.");
|
||||
|
||||
signal(signum, &SignalHandler::caught);
|
||||
m_handlers[signum] = slot;
|
||||
struct sigaction sa;
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sa.sa_flags = SA_RESTART;
|
||||
sa.sa_handler = &SignalHandler::caught;
|
||||
|
||||
if (sigaction(signum, &sa, NULL) == -1)
|
||||
throw std::logic_error("Could not set sigaction: " + std::string(rak::error_number::current().c_str()));
|
||||
else
|
||||
m_handlers[signum] = slot;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user