You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
769 B

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