chiark / gitweb /
cgroup: suppress sending follow-up SIGCONT after sending SIGCONT/SIGKILL anyway
authorLennart Poettering <lennart@poettering.net>
Wed, 20 Jul 2016 09:16:53 +0000 (11:16 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 16 Jun 2017 08:13:01 +0000 (10:13 +0200)
src/basic/cgroup-util.c

index 1e9ec33a97204a140a67687e257013733386b6f5..c98c1c4003dff4aa18c8d7419ef3f97d2e12ad80 100644 (file)
@@ -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 */