summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-07-20 11:16:53 +0200
committerLennart Poettering <lennart@poettering.net>2016-07-20 14:35:15 +0200
commit0d5b4810929f3e224c392ede913bb81042800101 (patch)
treec968e7effbc8d17d14dc6391262c0cf1dbd19943
parent1d98fef17d5fd746be163b3aac306068ecec3438 (diff)
cgroup: suppress sending follow-up SIGCONT after sending SIGCONT/SIGKILL anyway
-rw-r--r--src/basic/cgroup-util.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
index 630e15b141..472e24b7a3 100644
--- a/src/basic/cgroup-util.c
+++ b/src/basic/cgroup-util.c
@@ -213,6 +213,11 @@ int cg_kill(
assert(sig >= 0);
+ /* Don't send SIGCONT twice. Also, SIGKILL always works even when process is suspended, hence don't send
+ * SIGCONT on SIGKILL. */
+ if (IN_SET(sig, SIGCONT, SIGKILL))
+ flags &= ~CGROUP_SIGCONT;
+
/* This goes through the tasks list and kills them all. This
* is repeated until no further processes are added to the
* tasks list, to properly handle forking processes */