aboutsummaryrefslogtreecommitdiffstats
path: root/src/firejail/shutdown.c
diff options
context:
space:
mode:
authorLibravatar smitsohu <smitsohu@gmail.com>2019-02-18 13:16:34 +0100
committerLibravatar GitHub <noreply@github.com>2019-02-18 13:16:34 +0100
commitfaa1ec748bed88bce0e61f3149e82b4661ab761c (patch)
treec920c86d1e5e4aa6fd9f59778292418835a0b9c0 /src/firejail/shutdown.c
parentFixes (diff)
downloadfirejail-faa1ec748bed88bce0e61f3149e82b4661ab761c.tar.gz
firejail-faa1ec748bed88bce0e61f3149e82b4661ab761c.tar.zst
firejail-faa1ec748bed88bce0e61f3149e82b4661ab761c.zip
shutdown option: paranoid sleep
cf. #2401 increase head start to a full second
Diffstat (limited to 'src/firejail/shutdown.c')
-rw-r--r--src/firejail/shutdown.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/firejail/shutdown.c b/src/firejail/shutdown.c
index 05cfdc89e..24b3665fc 100644
--- a/src/firejail/shutdown.c
+++ b/src/firejail/shutdown.c
@@ -52,14 +52,13 @@ void shut(pid_t pid) {
52 printf("Sending SIGTERM to %u\n", pid); 52 printf("Sending SIGTERM to %u\n", pid);
53 kill(pid, SIGTERM); 53 kill(pid, SIGTERM);
54 54
55 // wait for not more than about 10 seconds 55 // wait for not more than 11 seconds
56 int monsec = 10; 56 int monsec = 11;
57 char *monfile; 57 char *monfile;
58 if (asprintf(&monfile, "/proc/%d/cmdline", pid) == -1) 58 if (asprintf(&monfile, "/proc/%d/cmdline", pid) == -1)
59 errExit("asprintf"); 59 errExit("asprintf");
60 int killdone = 0; 60 int killdone = 0;
61 61
62 usleep(200000); // give sandbox a little head start
63 while (monsec) { 62 while (monsec) {
64 sleep(1); 63 sleep(1);
65 monsec--; 64 monsec--;