Merge "init: Reduce the number of system calls"

This commit is contained in:
Bart Van Assche 2022-11-21 03:18:44 +00:00 committed by Gerrit Code Review
commit 254ae6c82b

View file

@ -244,7 +244,7 @@ Result<void> SetProcessAttributes(const ProcessAttributes& attr) {
setsid(); setsid();
OpenConsole(attr.console); OpenConsole(attr.console);
} else { } else {
if (setpgid(0, getpid()) == -1) { if (setpgid(0, 0) == -1) {
return ErrnoError() << "setpgid failed"; return ErrnoError() << "setpgid failed";
} }
SetupStdio(attr.stdio_to_kmsg); SetupStdio(attr.stdio_to_kmsg);