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.

24 lines
670 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. --- a/src/smsd.c
  6. +++ b/src/smsd.c
  7. @@ -34,6 +34,7 @@ Either version 2 of the License, or (at
  8. #ifndef DISABLE_INOTIFY
  9. #include <sys/inotify.h>
  10. #endif
  11. +#include <sys/prctl.h>
  12. #include "extras.h"
  13. #include "locking.h"
  14. @@ -8100,6 +8101,7 @@ int main(int argc,char** argv)
  15. if (pid == 0)
  16. {
  17. + prctl(PR_SET_PDEATHSIG, SIGTERM, 0, 0, 0);
  18. process_id = i;
  19. strcpy(process_title, DEVICE.name);
  20. apply_process_name(argc, argv, process_title);