mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-14 22:22:31 +00:00
Fix background task execution.
This commit is contained in:
@@ -81,6 +81,18 @@ SignalHandler::set_unblock(unsigned int signum) {
|
||||
throw std::logic_error("Could not unblock signal: " + std::string(std::strerror(errno)));
|
||||
}
|
||||
|
||||
void
|
||||
SignalHandler::set_sigchild_ignore() {
|
||||
struct sigaction sa;
|
||||
sa.sa_handler = SIG_IGN;
|
||||
sa.sa_flags = SA_NOCLDWAIT | SA_RESTART;
|
||||
|
||||
sigemptyset(&sa.sa_mask);
|
||||
|
||||
if (sigaction(SIGCHLD, &sa, NULL) == -1)
|
||||
throw std::logic_error("Could not set sigaction (ignore) for SIGCHLD: " + std::string(std::strerror(errno)));
|
||||
}
|
||||
|
||||
void
|
||||
SignalHandler::set_sigaction_handler(unsigned int signum, handler_slot slot) {
|
||||
if (signum >= HIGHEST_SIGNAL)
|
||||
|
||||
Reference in New Issue
Block a user