mirror of https://github.com/aria2/aria2
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.ccpull/1/head
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>
|
2010-06-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Use downloadresultcode::IN_PROGRESS for
|
Use downloadresultcode::IN_PROGRESS for
|
||||||
|
|
|
@ -75,12 +75,22 @@ extern volatile sig_atomic_t globalHaltRequested;
|
||||||
} // namespace global
|
} // namespace global
|
||||||
|
|
||||||
static void handler(int signal) {
|
static void handler(int signal) {
|
||||||
|
if(
|
||||||
|
#ifdef SIGHUP
|
||||||
|
signal == SIGHUP ||
|
||||||
|
#endif // SIGHUP
|
||||||
|
signal == SIGTERM) {
|
||||||
|
if(global::globalHaltRequested == 0 || global::globalHaltRequested == 2) {
|
||||||
|
global::globalHaltRequested = 3;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if(global::globalHaltRequested == 0) {
|
if(global::globalHaltRequested == 0) {
|
||||||
global::globalHaltRequested = 1;
|
global::globalHaltRequested = 1;
|
||||||
} else if(global::globalHaltRequested == 2) {
|
} else if(global::globalHaltRequested == 2) {
|
||||||
global::globalHaltRequested = 3;
|
global::globalHaltRequested = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MultiUrlRequestInfo::MultiUrlRequestInfo
|
MultiUrlRequestInfo::MultiUrlRequestInfo
|
||||||
(const std::vector<SharedHandle<RequestGroup> >& requestGroups,
|
(const std::vector<SharedHandle<RequestGroup> >& requestGroups,
|
||||||
|
|
Loading…
Reference in New Issue