summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>2017-10-31 10:05:02 +0000
committerGitHub <noreply@github.com>2017-10-31 10:05:02 +0000
commit0ed782021b3051043b9eefdc5c5cbd239c7f7ffe (patch)
tree91a8230c947d83ea1809188fa22b3e0ad1755689
parent8ef3d66d14122d809d0724b4bdfffd61d3d89b40 (diff)
parent3448a9698025844b0ddca6e4638b720b13180ffc (diff)
downloadsystemd-0ed782021b3051043b9eefdc5c5cbd239c7f7ffe.tar.gz
systemd-0ed782021b3051043b9eefdc5c5cbd239c7f7ffe.tar.bz2
systemd-0ed782021b3051043b9eefdc5c5cbd239c7f7ffe.zip
Merge pull request #7226 from sourcejedi/shutdown-misuse-commment
core: remove "misuse" of getpgid() in systemd-shutdown
-rw-r--r--src/core/killall.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/killall.c b/src/core/killall.c
index 5e914e478d..fe5320e813 100644
--- a/src/core/killall.c
+++ b/src/core/killall.c
@@ -129,9 +129,9 @@ static void wait_for_children(Set *pids, sigset_t *mask) {
* might not be our child. */
SET_FOREACH(p, pids, i) {
- /* We misuse getpgid as a check whether a
- * process still exists. */
- if (getpgid(PTR_TO_PID(p)) >= 0)
+ /* kill(pid, 0) sends no signal, but it tells
+ * us whether the process still exists. */
+ if (kill(PTR_TO_PID(p), 0) == 0)
continue;
if (errno != ESRCH)