moonbridge
changeset 277:4f965eda4c2f
Ignore SIGTERM once after sending it to own process group
author | jbe |
---|---|
date | Tue Jun 06 18:00:30 2017 +0200 (2017-06-06) |
parents | 99ebca235c95 |
children | d4c82c90d244 |
files | moonbridge.c |
line diff
1.1 --- a/moonbridge.c Tue Jun 06 17:58:19 2017 +0200 1.2 +++ b/moonbridge.c Tue Jun 06 18:00:30 2017 +0200 1.3 @@ -1129,6 +1129,11 @@ 1.4 static void moonbr_initiate_shutdown() { 1.5 struct moonbr_pool *pool; 1.6 int i; 1.7 + static int ignore_once = 0; 1.8 + if (ignore_once) { 1.9 + ignore_once = 0; 1.10 + return; 1.11 + } 1.12 if (moonbr_shutdown_in_progress) { 1.13 moonbr_log(LOG_NOTICE, "Shutdown already in progress"); 1.14 return; 1.15 @@ -1153,6 +1158,7 @@ 1.16 if (killpg(pgrp, SIGTERM)) { 1.17 moonbr_log(LOG_WARNING, "Error while sending SIGTERM to own process group: %s", strerror(errno)); 1.18 } 1.19 + ignore_once = 1; 1.20 } 1.21 } 1.22