1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:37:34 +00:00

LoginServer: Correctly retrieve SystemServer's exit code

The returned value of `waitpid` is the PID of the process and not the
exit code.
This commit is contained in:
Lucas CHOLLET 2022-07-17 14:43:21 +02:00 committed by Linus Groh
parent 8266ebf3c6
commit cc0d53d6a6

View file

@ -46,8 +46,8 @@ static void login(Core::Account const& account, LoginWindow& window)
pid_t rc = waitpid(pid, &wstatus, 0); pid_t rc = waitpid(pid, &wstatus, 0);
if (rc == -1) if (rc == -1)
dbgln("waitpid failed: {}", strerror(errno)); dbgln("waitpid failed: {}", strerror(errno));
if (rc != 0) if (WIFEXITED(wstatus) && WEXITSTATUS(wstatus) != 0)
dbgln("SystemServer exited with non-zero status: {}", rc); dbgln("SystemServer exited with non-zero status: {}", WEXITSTATUS(wstatus));
window.show(); window.show();
} }