diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-12-26 13:18:23 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-12-26 13:18:23 +0000 |
| commit | 63c6a16d400a37a5ec0a598aebbcd2b1fac87996 (patch) | |
| tree | 8e72c530a6daf08aa3334cda87e4e1d365866d02 /src/MultiUrlRequestInfo.cc | |
| parent | 1c331e901a5e036e16b89205e933d4d5cdaf17d4 (diff) | |
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
Diffstat (limited to 'src/MultiUrlRequestInfo.cc')
| -rw-r--r-- | src/MultiUrlRequestInfo.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/MultiUrlRequestInfo.cc b/src/MultiUrlRequestInfo.cc index a027718e..5a06e51e 100644 --- a/src/MultiUrlRequestInfo.cc +++ b/src/MultiUrlRequestInfo.cc @@ -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; |
