openwrt/package/network/config/ltq-vdsl-vr9-app/patches/201-sigterm.patch
Jan Hoffmann 663389c4cf ltq-vdsl-vr9-app: always disconnect on exit
Move the code for disconnection on exit to a separate function, and also
call it in the code path for the "quit" CLI command.

While at it, make the patch description a bit clearer.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2024-08-31 19:40:21 +02:00

20 lines
618 B
Diff

--- a/src/dsl_cpe_control.c
+++ b/src/dsl_cpe_control.c
@@ -6555,7 +6555,7 @@ DSL_CPE_STATIC void DSL_CPE_Termination
/* ignore the signal, we'll handle by ourself */
signal (sig, SIG_IGN);
- if (sig == SIGINT)
+ if (sig == SIGINT || sig == SIGTERM)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX "terminated" DSL_CPE_CRLF));
DSL_CPE_Termination ();
@@ -6809,6 +6809,7 @@ DSL_int_t dsl_cpe_daemon (
#ifndef RTEMS
signal (SIGINT, DSL_CPE_TerminationHandler);
+ signal (SIGTERM, DSL_CPE_TerminationHandler);
#endif /* RTEMS*/
/* Open DSL_CPE_MAX_DSL_ENTITIES devices*/