fix(pty): initialize exit_code to 0

Uninitialized exit_code variable was causing tests to fail on x86_32
arch due to returning an arbitrary int where 0 was expected.
This commit is contained in:
Leroy Hopson 2024-04-01 09:24:10 +13:00
parent 9f7e00f6a4
commit 6c8be30e7f
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
2 changed files with 1 additions and 3 deletions

View file

@ -168,7 +168,7 @@ static void await_exit(Callable cb, pid_t pid) {
break;
}
#endif
int exit_code, signal_code = 0;
int exit_code = 0, signal_code = 0;
if (WIFEXITED(stat_loc)) {
exit_code = WEXITSTATUS(stat_loc); // errno?
}

View file

@ -102,8 +102,6 @@ func test_emits_exited_on_kill():
func test_emits_exited_with_signal():
if Engine.get_architecture_name() == "x86_32":
return # FIXME: This test fails on 32-bit builds.
subject.call("fork", "yes")
await wait_frames(1)
subject.call_deferred("kill", PTY.SIGNAL_SIGSEGV)