diff options
author | 2019-02-18 13:16:34 +0100 | |
---|---|---|
committer | 2019-02-18 13:16:34 +0100 | |
commit | faa1ec748bed88bce0e61f3149e82b4661ab761c (patch) | |
tree | c920c86d1e5e4aa6fd9f59778292418835a0b9c0 | |
parent | Fixes (diff) | |
download | firejail-faa1ec748bed88bce0e61f3149e82b4661ab761c.tar.gz firejail-faa1ec748bed88bce0e61f3149e82b4661ab761c.tar.zst firejail-faa1ec748bed88bce0e61f3149e82b4661ab761c.zip |
shutdown option: paranoid sleep
cf. #2401
increase head start to a full second
-rw-r--r-- | src/firejail/shutdown.c | 5 |
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--; |