1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-11 05:17:44 +03:00

Merge pull request #7226 from sourcejedi/shutdown-misuse-commment

core: remove "misuse" of getpgid() in systemd-shutdown
This commit is contained in:
Alan Jenkins 2017-10-31 10:05:02 +00:00 committed by GitHub
commit 0ed782021b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,9 +129,9 @@ static void wait_for_children(Set *pids, sigset_t *mask) {
* might not be our child. */ * might not be our child. */
SET_FOREACH(p, pids, i) { SET_FOREACH(p, pids, i) {
/* We misuse getpgid as a check whether a /* kill(pid, 0) sends no signal, but it tells
* process still exists. */ * us whether the process still exists. */
if (getpgid(PTR_TO_PID(p)) >= 0) if (kill(PTR_TO_PID(p), 0) == 0)
continue; continue;
if (errno != ESRCH) if (errno != ESRCH)