mirror of
https://github.com/aria2/aria2.git
synced 2025-01-09 03:21:33 +00:00
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
This commit is contained in:
parent
1986f45d4a
commit
bf5e76a9a2
@ -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>
|
||||
|
||||
Use downloadresultcode::IN_PROGRESS for
|
||||
|
@ -75,10 +75,20 @@ extern volatile sig_atomic_t globalHaltRequested;
|
||||
} // namespace global
|
||||
|
||||
static void handler(int signal) {
|
||||
if(global::globalHaltRequested == 0) {
|
||||
global::globalHaltRequested = 1;
|
||||
} else if(global::globalHaltRequested == 2) {
|
||||
global::globalHaltRequested = 3;
|
||||
if(
|
||||
#ifdef SIGHUP
|
||||
signal == SIGHUP ||
|
||||
#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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user