ltq-vdsl-app: disconnect when service is stopped
[openwrt/staging/mkresin.git] / package / network / config / ltq-vdsl-app / patches / 201-sigterm.patch
1 --- a/src/dsl_cpe_control.c
2 +++ b/src/dsl_cpe_control.c
3 @@ -6504,7 +6504,7 @@ DSL_CPE_STATIC void DSL_CPE_Termination
4 /* ignore the signal, we'll handle by ourself */
5 signal (sig, SIG_IGN);
6
7 - if (sig == SIGINT)
8 + if (sig == SIGINT || sig == SIGTERM)
9 {
10 DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX "terminated" DSL_CPE_CRLF));
11 DSL_CPE_Termination ();
12 @@ -6803,6 +6803,7 @@ DSL_int_t dsl_cpe_daemon (
13
14 #ifndef RTEMS
15 signal (SIGINT, DSL_CPE_TerminationHandler);
16 + signal (SIGTERM, DSL_CPE_TerminationHandler);
17 #endif /* RTEMS*/
18
19 /* Open DSL_CPE_MAX_DSL_ENTITIES devices*/