2010-06-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Treat SIGHUP and SIGTERM signal as emergency shutdown because they
	are usually issued by system or other process.
	* src/MultiUrlRequestInfo.cc
pull/1/head
Tatsuhiro Tsujikawa 2010-06-03 11:52:44 +00:00
parent 1986f45d4a
commit bf5e76a9a2
2 changed files with 20 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2010-06-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Treat SIGHUP and SIGTERM signal as emergency shutdown because they
are usually issued by system or other process.
* src/MultiUrlRequestInfo.cc
2010-06-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> 2010-06-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use downloadresultcode::IN_PROGRESS for Use downloadresultcode::IN_PROGRESS for

View File

@ -75,10 +75,20 @@ extern volatile sig_atomic_t globalHaltRequested;
} // namespace global } // namespace global
static void handler(int signal) { static void handler(int signal) {
if(global::globalHaltRequested == 0) { if(
global::globalHaltRequested = 1; #ifdef SIGHUP
} else if(global::globalHaltRequested == 2) { signal == SIGHUP ||
global::globalHaltRequested = 3; #endif // SIGHUP
signal == SIGTERM) {
if(global::globalHaltRequested == 0 || global::globalHaltRequested == 2) {
global::globalHaltRequested = 3;
}
} else {
if(global::globalHaltRequested == 0) {
global::globalHaltRequested = 1;
} else if(global::globalHaltRequested == 2) {
global::globalHaltRequested = 3;
}
} }
} }