2009-12-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Added signal handler for SIGHUP to save .aria2 file when terminal
	is closed. The handler is the same one for SIGINT and SIGTERM.
	* src/MultiUrlRequestInfo.cc
pull/1/head
Tatsuhiro Tsujikawa 2009-12-26 13:18:23 +00:00
parent 1c331e901a
commit 63c6a16d40
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2009-12-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added signal handler for SIGHUP to save .aria2 file when terminal
is closed. The handler is the same one for SIGINT and SIGTERM.
* src/MultiUrlRequestInfo.cc
2009-12-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Defined method name in XmlRpcMethod subclasses.

View File

@ -161,6 +161,7 @@ downloadresultcode::RESULT MultiUrlRequestInfo::execute()
}
e->setStatCalc(_statCalc);
util::setGlobalSignalHandler(SIGHUP, handler, 0);
util::setGlobalSignalHandler(SIGINT, handler, 0);
util::setGlobalSignalHandler(SIGTERM, handler, 0);
@ -190,6 +191,7 @@ downloadresultcode::RESULT MultiUrlRequestInfo::execute()
} catch(RecoverableException& e) {
_logger->error(EX_EXCEPTION_CAUGHT, e);
}
util::setGlobalSignalHandler(SIGHUP, SIG_DFL, 0);
util::setGlobalSignalHandler(SIGINT, SIG_DFL, 0);
util::setGlobalSignalHandler(SIGTERM, SIG_DFL, 0);
return returnValue;