clatd: only wait 15s for SIGTERM during shutdown
Test: TreeHugger Bug: 277682237 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: If69c00f6f1c3cc1db9f8942852eeb1dbd0b4ab2e
This commit is contained in:
parent
4063f3e884
commit
9c05f75eaa
1 changed files with 6 additions and 2 deletions
8
main.c
8
main.c
|
|
@ -194,8 +194,12 @@ int main(int argc, char **argv) {
|
|||
|
||||
if (running) {
|
||||
logmsg(ANDROID_LOG_INFO, "Clatd on %s waiting for SIGTERM", uplink_interface);
|
||||
while (running) sleep(60);
|
||||
logmsg(ANDROID_LOG_INFO, "Clatd on %s received SIGTERM", uplink_interface);
|
||||
// let's give higher level java code 15 seconds to kill us,
|
||||
// but eventually terminate anyway, in case system server forgets about us...
|
||||
// sleep() should be interrupted by SIGTERM, the handler should clear running
|
||||
sleep(15);
|
||||
logmsg(ANDROID_LOG_INFO, "Clatd on %s %s SIGTERM", uplink_interface,
|
||||
running ? "timed out waiting for" : "received");
|
||||
} else {
|
||||
logmsg(ANDROID_LOG_INFO, "Clatd on %s already received SIGTERM", uplink_interface);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue