Revert "init: Fix a race condition in KillProcessGroup()"
This reverts commit d8ef6f84d4df1b0cb9aab942ea221020bde61c6a.
Reason for revert: b/256874349
Change-Id: I86a1e03a0d2979db1c54abd3e78c32591fda98a1
diff --git a/init/service_utils.cpp b/init/service_utils.cpp
index 56a80b5..a14969e 100644
--- a/init/service_utils.cpp
+++ b/init/service_utils.cpp
@@ -244,11 +244,7 @@
setsid();
OpenConsole(attr.console);
} else {
- // Without PID namespaces, this call duplicates the setpgid() call from
- // the parent process. With PID namespaces, this setpgid() call sets the
- // process group ID for a child of the init process in the PID
- // namespace.
- if (setpgid(0, 0) == -1) {
+ if (setpgid(0, getpid()) == -1) {
return ErrnoError() << "setpgid failed";
}
SetupStdio(attr.stdio_to_kmsg);