smstools3: Move init script to use procd
[feed/packages.git] / utils / smstools3 / patches / 004-modem-processes.patch
1 commit 3790bd05ed86b1692719df22857ef76c1293b01c
2 Author: Harald Geyer <harald@ccbib.org>
3 Date: Sun Feb 18 19:24:48 2018 +0100
4
5 Make modem processes terminate when main process dies
6
7 diff --git a/src/smsd.c b/src/smsd.c
8 index fdfa193..37b2e4d 100755
9 --- a/src/smsd.c
10 +++ b/src/smsd.c
11 @@ -34,6 +34,7 @@ Either version 2 of the License, or (at your option) any later version.
12 #ifndef DISABLE_INOTIFY
13 #include <sys/inotify.h>
14 #endif
15 +#include <sys/prctl.h>
16
17 #include "extras.h"
18 #include "locking.h"
19 @@ -8100,6 +8101,7 @@ int main(int argc,char** argv)
20
21 if (pid == 0)
22 {
23 + prctl(PR_SET_PDEATHSIG, SIGTERM, 0, 0, 0);
24 process_id = i;
25 strcpy(process_title, DEVICE.name);
26 apply_process_name(argc, argv, process_title);