From 6c8be30e7f349396ce5d3a08aae09e17c2814c4a Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Mon, 1 Apr 2024 09:24:10 +1300 Subject: [PATCH] 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. --- addons/godot_xterm/native/src/pty_unix.cpp | 2 +- test/test_nix.gd | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/godot_xterm/native/src/pty_unix.cpp b/addons/godot_xterm/native/src/pty_unix.cpp index 4f5d196..95ea30c 100644 --- a/addons/godot_xterm/native/src/pty_unix.cpp +++ b/addons/godot_xterm/native/src/pty_unix.cpp @@ -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? } diff --git a/test/test_nix.gd b/test/test_nix.gd index 5eada0f..2fee26b 100644 --- a/test/test_nix.gd +++ b/test/test_nix.gd @@ -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)